@@ -1,258 +1,12 @@
|
||||
#ifndef ENGINE_SHADER_DEFINES_HLSLI
|
||||
#define ENGINE_SHADER_DEFINES_HLSLI
|
||||
|
||||
vector g_vMtrlDiffuse = 1.f;
|
||||
vector g_vMtrlAmbient = 1.f;
|
||||
vector g_vMtrlSpecular = 1.f;
|
||||
|
||||
float PI = 3.14592;
|
||||
|
||||
sampler DefaultSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
AddressU = wrap;
|
||||
AddressV = wrap;
|
||||
};
|
||||
|
||||
sampler ClampSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_POINT;
|
||||
AddressU = clamp;
|
||||
AddressV = clamp;
|
||||
};
|
||||
|
||||
sampler MirrorSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
AddressU = mirror;
|
||||
AddressV = mirror;
|
||||
};
|
||||
|
||||
sampler BorderZeroSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_POINT;
|
||||
AddressU = Border;
|
||||
AddressV = Border;
|
||||
BorderColor = float4(0, 0, 0, 0);
|
||||
};
|
||||
|
||||
sampler PointSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_POINT;
|
||||
AddressU = wrap;
|
||||
AddressV = wrap;
|
||||
};
|
||||
|
||||
RasterizerState RS_Default
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = Back;
|
||||
};
|
||||
|
||||
RasterizerState RS_Nocull
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = None;
|
||||
FrontCounterClockwise = false;
|
||||
DepthClipEnable = false;
|
||||
};
|
||||
|
||||
RasterizerState RS_Nocull_Wireframe
|
||||
{
|
||||
FillMode = Wireframe;
|
||||
CullMode = None;
|
||||
FrontCounterClockwise = false;
|
||||
DepthBias = 0;
|
||||
SlopeScaledDepthBias = 0.f;
|
||||
DepthBiasClamp = 0.f;
|
||||
DepthClipEnable = false;
|
||||
ScissorEnable = false;
|
||||
MultisampleEnable = false;
|
||||
AntialiasedLineEnable = false;
|
||||
};
|
||||
|
||||
RasterizerState RS_Scissor
|
||||
{
|
||||
FillMode = Solid;
|
||||
CullMode = Back;
|
||||
FrontCounterClockwise = false;
|
||||
ScissorEnable = true;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_Default
|
||||
{
|
||||
DepthEnable = true;
|
||||
DepthWriteMask = all;
|
||||
DepthFunc = less_equal;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_None
|
||||
{
|
||||
DepthEnable = false;
|
||||
DepthWriteMask = zero;
|
||||
};
|
||||
|
||||
DepthStencilState DSS_Effect
|
||||
{
|
||||
DepthEnable = true;
|
||||
DepthWriteMask = zero;
|
||||
DepthFunc = less_equal;
|
||||
StencilEnable = false;
|
||||
};
|
||||
|
||||
BlendState BS_None
|
||||
{
|
||||
BlendEnable[0] = false;
|
||||
};
|
||||
|
||||
BlendState BS_AlphaBlend // ALPHA_BLEND
|
||||
{
|
||||
BlendEnable[0] = true;
|
||||
BlendEnable[1] = true;
|
||||
BlendEnable[2] = true;
|
||||
BlendEnable[3] = true;
|
||||
BlendEnable[4] = true;
|
||||
BlendEnable[5] = true;
|
||||
BlendEnable[6] = true;
|
||||
BlendEnable[7] = true;
|
||||
|
||||
// Ac * Aa + Bc * (1 - Aa);
|
||||
SrcBlend = Src_Alpha;
|
||||
DestBlend = Inv_Src_Alpha;
|
||||
BlendOp = Add;
|
||||
};
|
||||
|
||||
BlendState BS_Blend // ADDITIVE_BLEND
|
||||
{
|
||||
BlendEnable[0] = true;
|
||||
BlendEnable[1] = true;
|
||||
BlendEnable[2] = true;
|
||||
BlendEnable[3] = true;
|
||||
BlendEnable[4] = true;
|
||||
BlendEnable[5] = true;
|
||||
BlendEnable[6] = true;
|
||||
BlendEnable[7] = true;
|
||||
|
||||
// Ac * (1) + Bc * (1);
|
||||
SrcBlend = one;
|
||||
DestBlend = one;
|
||||
BlendOp = Add;
|
||||
};
|
||||
|
||||
BlendState BS_UIBlend
|
||||
{
|
||||
BlendEnable[0] = true;
|
||||
BlendEnable[1] = true;
|
||||
BlendEnable[2] = true;
|
||||
BlendEnable[3] = true;
|
||||
BlendEnable[4] = true;
|
||||
BlendEnable[5] = true;
|
||||
BlendEnable[6] = true;
|
||||
BlendEnable[7] = true;
|
||||
|
||||
SrcBlend = Src_Alpha;
|
||||
DestBlend = Inv_Src_Alpha;
|
||||
BlendOp = Add;
|
||||
|
||||
SrcBlendAlpha = One;
|
||||
DestBlendAlpha = Zero;
|
||||
BlendOpAlpha = Add;
|
||||
|
||||
RenderTargetWriteMask[0] = 0x0F; // RGBA 모두 출력
|
||||
};
|
||||
|
||||
BlendState BS_WB_Acc
|
||||
{
|
||||
BlendEnable[0] = true;
|
||||
BlendEnable[1] = true;
|
||||
BlendEnable[2] = true;
|
||||
BlendEnable[3] = true;
|
||||
BlendEnable[4] = true;
|
||||
BlendEnable[5] = true;
|
||||
BlendEnable[6] = true;
|
||||
BlendEnable[7] = true;
|
||||
|
||||
SrcBlend[0] = one;
|
||||
DestBlend[0] = one;
|
||||
BlendOp[0] = Add;
|
||||
|
||||
SrcBlend[1] = Zero;
|
||||
DestBlend[1] = Inv_Src_Alpha;
|
||||
BlendOp[1] = Add;
|
||||
#include "Engine_Shader_Constants.hlsli"
|
||||
#include "Engine_Shader_Structures.hlsli"
|
||||
#include "Engine_Shader_Samplers.hlsli"
|
||||
#include "Engine_Shader_States.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
|
||||
SrcBlend[2] = one;
|
||||
DestBlend[2] = one;
|
||||
BlendOp[2] = Add;
|
||||
};
|
||||
#endif // ENGINE_SHADER_DEFINES_HLSLI
|
||||
|
||||
BlendState BS_WeightBlend
|
||||
{
|
||||
BlendEnable[0] = true;
|
||||
BlendEnable[1] = true;
|
||||
BlendEnable[2] = true;
|
||||
BlendEnable[3] = true;
|
||||
BlendEnable[4] = true;
|
||||
BlendEnable[5] = true;
|
||||
BlendEnable[6] = true;
|
||||
BlendEnable[7] = true;
|
||||
|
||||
|
||||
SrcBlend[0] = Src_Alpha;
|
||||
DestBlend[0] = Inv_Src_Alpha;
|
||||
|
||||
BlendOp[0] = Add;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vShadowMapSize, float bias)
|
||||
{
|
||||
float2 uv = float2(vLightClip.x / vLightClip.w, -vLightClip.y / vLightClip.w) * 0.5f + 0.5f;
|
||||
float fDepthCenter = saturate(vLightClip.z / vLightClip.w);
|
||||
float2 vTexel = 1.f / vShadowMapSize;
|
||||
|
||||
float fVisibility = 0.f;
|
||||
for (int v = -1; v <= 1; ++v)
|
||||
{
|
||||
for (int u = -1; u <= 1; ++u)
|
||||
{
|
||||
float2 vOffset = float2(u, v) * vTexel;
|
||||
float fDepth = ShadowMap.Sample(DefaultSampler, uv + vOffset).x;
|
||||
fVisibility += (fDepthCenter - bias > fDepth) ? 0.f : 1.f;
|
||||
}
|
||||
}
|
||||
return fVisibility / 9.f;
|
||||
}
|
||||
|
||||
float GetRimLight(float3 vCamPosition, float3 vPosition, float3 vNormal, float fRimPower, float fRimStrength)
|
||||
{
|
||||
float fRimLight = (1 - dot(normalize(vCamPosition - vPosition), vNormal));
|
||||
fRimLight = pow(fRimLight, fRimPower);
|
||||
fRimLight = fRimLight * fRimStrength;
|
||||
return fRimLight;
|
||||
}
|
||||
|
||||
float2 Get_MovedUV(float2 vOriginalUV, float fDeltaU, float fDeltaV, uint iIndexU, uint iIndexV)
|
||||
{
|
||||
float2 vDelta = float2(fDeltaU, fDeltaV);
|
||||
float2 vOffset = float2(iIndexU * fDeltaU, iIndexV * fDeltaV);
|
||||
return vOriginalUV * vDelta + vOffset;
|
||||
}
|
||||
|
||||
float2 UV_Cutting(float2 vUV, float2 vUVCutting, int iCurrentFrame)
|
||||
{
|
||||
float2 UV = vUV; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = vUVCutting.x * vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / 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로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
return UV;
|
||||
}
|
||||
|
||||
@@ -35,14 +35,13 @@ Texture2D g_BlurTexture;
|
||||
Texture2D g_BlurXTexture;
|
||||
Texture2D g_BlurWeightTexture;
|
||||
|
||||
Texture2D g_SurfaceTexture;
|
||||
|
||||
|
||||
vector g_vLightDiffuse;
|
||||
vector g_vLightAmbient;
|
||||
vector g_vLightSpecular;
|
||||
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
@@ -56,9 +55,9 @@ struct VS_OUT
|
||||
};
|
||||
VS_OUT VS_MAIN(VS_IN In)
|
||||
{
|
||||
VS_OUT Out;
|
||||
VS_OUT Out;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
@@ -66,7 +65,7 @@ VS_OUT VS_MAIN(VS_IN In)
|
||||
Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP);
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
|
||||
return Out;
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_IN
|
||||
@@ -99,41 +98,62 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
{
|
||||
PS_OUT_LIGHT Out;
|
||||
|
||||
vector vNormalDesc = g_NormalTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float2 uv = In.vTexcoord;
|
||||
|
||||
float4 vNormal = vector(vNormalDesc.xyz * 2.f - 1.f, 0.0f);
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir) * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient));
|
||||
float fViewZ = vDepth.y * g_fFar;
|
||||
|
||||
vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float4 vWorldPosition;
|
||||
{
|
||||
vWorldPosition.x = uv.x * 2 - 1;
|
||||
vWorldPosition.y = uv.y * -2 + 1;
|
||||
vWorldPosition.z = vDepth.x;
|
||||
vWorldPosition.w = 1.f;
|
||||
vWorldPosition *= fViewZ;
|
||||
vWorldPosition = mul(vWorldPosition, g_invmatProj);
|
||||
vWorldPosition = mul(vWorldPosition, g_invMatView);
|
||||
}
|
||||
|
||||
float fViewZ = vDepthDesc.y * g_fFar;
|
||||
|
||||
vector vPosition;
|
||||
float3 vF0 = float3(0.04f, 0.04f, 0.04f);
|
||||
float fMetallic = 0.f;
|
||||
float fRoughness = 0.f;
|
||||
float fOcclusion = 1.f;
|
||||
float fAttenuation = 1.f;
|
||||
|
||||
{ // vDepthDesc과 vTexcoord.xy로부터 World Position의 추론
|
||||
/* 직육면체의 NDC */
|
||||
/* LocalPos * World * View * Proj * ( 1 / w ) */
|
||||
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
|
||||
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
|
||||
vPosition.z = vDepthDesc.x;
|
||||
vPosition.w = 1.f;
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로
|
||||
float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로
|
||||
|
||||
/* [* (1 / w)] 소거*/
|
||||
/* z나누기를 되돌림 */
|
||||
vPosition = vPosition * fViewZ;
|
||||
// vPosition.x = In.vTexcoord.x * 2.f - 1.f * Far;
|
||||
// vPosition.y = In.vTexcoord.y * -2.f + 1.f * Far;
|
||||
// vPosition.z = vDepthDesc.x * Far;
|
||||
// vPosition.w = Far;
|
||||
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
}
|
||||
vector vLook = vPosition - g_vCamPosition;
|
||||
vector vReflect = reflect(normalize(g_vLightDir), vNormal);
|
||||
if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic
|
||||
{
|
||||
float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb;
|
||||
fMetallic = vMRO.r;
|
||||
fRoughness = vMRO.g;
|
||||
fOcclusion = vMRO.b;
|
||||
|
||||
vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic);
|
||||
}
|
||||
else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular
|
||||
{
|
||||
fMetallic = 0.f;
|
||||
|
||||
float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb;
|
||||
vF0 = vSRO.rrr;
|
||||
fRoughness = vSRO.g;
|
||||
fOcclusion = vSRO.b;
|
||||
}
|
||||
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(normalize(vLook) * -1.f, normalize(vReflect)), 0.f), 50.f);
|
||||
float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion);
|
||||
|
||||
PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0);
|
||||
|
||||
PBR_Out.vShade *= fDiffuseAOStrength;
|
||||
saturate(PBR_Out.vShade);
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(PBR_Out.vSpecular, 1.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -142,38 +162,62 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
{
|
||||
PS_OUT_LIGHT Out;
|
||||
|
||||
vector vNormalDesc = g_NormalTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float2 uv = In.vTexcoord;
|
||||
|
||||
float4 vNormal = vector(vNormalDesc.xyz * 2.f - 1.f, 0.f);
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
|
||||
vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float fViewZ = vDepthDesc.y * g_fFar;
|
||||
float fViewZ = vDepth.y * g_fFar;
|
||||
|
||||
vector vPosition;
|
||||
/* 0 ~ 1 에서 -1 ~ 1 */
|
||||
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
|
||||
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
|
||||
vPosition.z = vDepthDesc.x;
|
||||
vPosition.w = 1.f;
|
||||
vPosition = vPosition * fViewZ;
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
|
||||
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
|
||||
float fDistance = length(vLightDir);
|
||||
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f)
|
||||
float4 vWorldPosition;
|
||||
{
|
||||
discard;
|
||||
vWorldPosition.x = uv.x * 2 - 1;
|
||||
vWorldPosition.y = uv.y * -2 + 1;
|
||||
vWorldPosition.z = vDepth.x;
|
||||
vWorldPosition.w = 1.f;
|
||||
vWorldPosition *= fViewZ;
|
||||
vWorldPosition = mul(vWorldPosition, g_invmatProj);
|
||||
vWorldPosition = mul(vWorldPosition, g_invMatView);
|
||||
}
|
||||
vLightDir = normalize(vLightDir);
|
||||
|
||||
Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vLightDir * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient)));
|
||||
float3 vF0 = float3(0.04f, 0.04f, 0.04f);
|
||||
float fMetallic = 0.f;
|
||||
float fRoughness = 0.5f;
|
||||
float fOcclusion = 1.f;
|
||||
float fAttenuation = 1.f;
|
||||
|
||||
vector vLook = vPosition - g_vCamPosition;
|
||||
vector vReflect = reflect(vLightDir, vNormal);
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로
|
||||
float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로
|
||||
|
||||
Out.vSpecular = fAttenuation * ((g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(normalize(vLook) * -1.f, normalize(vReflect)), 0.f), 50.f));
|
||||
{
|
||||
float fDistance = length(vToLight);
|
||||
fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f) { discard; }
|
||||
}
|
||||
|
||||
if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic
|
||||
{
|
||||
float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb;
|
||||
fMetallic = vMRO.r;
|
||||
fRoughness = vMRO.g;
|
||||
fOcclusion = vMRO.b;
|
||||
|
||||
vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic);
|
||||
}
|
||||
else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular
|
||||
{
|
||||
fMetallic = 0.f;
|
||||
float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb;
|
||||
vF0 = vSRO.rrr;
|
||||
fRoughness = vSRO.g;
|
||||
fOcclusion = vSRO.b;
|
||||
}
|
||||
|
||||
PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0);
|
||||
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(PBR_Out.vSpecular, 1.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -182,46 +226,67 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
{
|
||||
PS_OUT_LIGHT Out;
|
||||
|
||||
vector vNormalDesc = g_NormalTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float2 uv = In.vTexcoord;
|
||||
|
||||
float4 vNormal = vector(vNormalDesc.xyz * 2.f - 1.f, 0.f);
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
|
||||
vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float fViewZ = vDepthDesc.y * g_fFar;
|
||||
float fViewZ = vDepth.y * g_fFar;
|
||||
|
||||
vector vPosition;
|
||||
/* 0 ~ 1 에서 -1 ~ 1 */
|
||||
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
|
||||
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
|
||||
vPosition.z = vDepthDesc.x;
|
||||
vPosition.w = 1.f;
|
||||
vPosition = vPosition * fViewZ;
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
|
||||
vector vLightDir = vPosition - g_vLightPos;
|
||||
float fDistance = length(vLightDir);
|
||||
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f)
|
||||
float4 vWorldPosition;
|
||||
{
|
||||
discard;
|
||||
vWorldPosition.x = uv.x * 2 - 1;
|
||||
vWorldPosition.y = uv.y * -2 + 1;
|
||||
vWorldPosition.z = vDepth.x;
|
||||
vWorldPosition.w = 1.f;
|
||||
vWorldPosition *= fViewZ;
|
||||
vWorldPosition = mul(vWorldPosition, g_invmatProj);
|
||||
vWorldPosition = mul(vWorldPosition, g_invMatView);
|
||||
}
|
||||
vLightDir = normalize(vLightDir);
|
||||
vector vSpotDir = normalize(g_vLightDir);
|
||||
float fCosAngle = dot(vLightDir, vSpotDir);
|
||||
if (fCosAngle < g_fSpotOuterAngle)
|
||||
|
||||
float3 vF0 = float3(0.04f, 0.04f, 0.04f);
|
||||
float fMetallic = 0.f;
|
||||
float fRoughness = 0.5f;
|
||||
float fOcclusion = 1.f;
|
||||
float fAttenuation = 1.f;
|
||||
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로
|
||||
float3 vToLight = normalize(g_vLightPos.xyz - vWorldPosition.xyz); // 픽셀에서 라이트로
|
||||
|
||||
{
|
||||
discard;
|
||||
float fDistance = length(vToLight);
|
||||
fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f) { discard; }
|
||||
}
|
||||
float fSpotAttenenuation = saturate((fCosAngle - g_fSpotInnerAngle) / (g_fSpotInnerAngle - g_fSpotOuterAngle));
|
||||
float fCosAngle = dot(vToView, g_vLightDir.xyz);
|
||||
if (fCosAngle < g_fSpotOuterAngle) { discard; }
|
||||
|
||||
float fSpotAttenenuation = saturate((fCosAngle - g_fSpotInnerAngle) / (g_fSpotInnerAngle - g_fSpotOuterAngle));
|
||||
fAttenuation *= fSpotAttenenuation;
|
||||
|
||||
Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vLightDir * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient)));
|
||||
if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_METALNESS)) // Metallic
|
||||
{
|
||||
float3 vMRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb;
|
||||
fMetallic = vMRO.r;
|
||||
fRoughness = vMRO.g;
|
||||
fOcclusion = vMRO.b;
|
||||
|
||||
vF0 = lerp(float3(0.04f, 0.04f, 0.04f), vAlbedo, fMetallic);
|
||||
}
|
||||
else if (true == AlmostEqual3(vDepth.b, AI_TEXTURE_TYPE_SPECULAR)) // Specular
|
||||
{
|
||||
fMetallic = 0.f;
|
||||
float3 vSRO = g_SurfaceTexture.Sample(DefaultSampler, uv).rgb;
|
||||
vF0 = vSRO.rrr;
|
||||
fRoughness = vSRO.g;
|
||||
fOcclusion = vSRO.b;
|
||||
}
|
||||
|
||||
vector vLook = vPosition - g_vCamPosition;
|
||||
vector vReflect = reflect(vLightDir, vNormal);
|
||||
PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0);
|
||||
|
||||
Out.vSpecular = fAttenuation * ((g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(normalize(vLook) * -1.f, normalize(vReflect)), 0.f), 50.f));
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(PBR_Out.vSpecular, 1.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -271,6 +336,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
vPreShadowPosition = vPosition;
|
||||
|
||||
/* (로컬위치 * 월드) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) */
|
||||
vPosition = mul(vPosition, g_LightViewMatrix);
|
||||
vPosition = mul(vPosition, g_LightProjMatrix);
|
||||
@@ -289,6 +355,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static));
|
||||
|
||||
//float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x;
|
||||
//float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x;
|
||||
//bool IsShadow = { false };
|
||||
@@ -323,6 +390,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
@@ -377,7 +445,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
vColor += g_fWeights[i + 15] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -385,7 +453,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
|
||||
technique11 DefaultTechnique
|
||||
{
|
||||
pass DebugPass
|
||||
pass DebugPass // 0
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
@@ -395,7 +463,7 @@ technique11 DefaultTechnique
|
||||
PixelShader = compile ps_5_0 PS_MAIN_DEBUG();
|
||||
}
|
||||
|
||||
pass DirectionalPass
|
||||
pass DirectionalPass // 1
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
@@ -405,7 +473,7 @@ technique11 DefaultTechnique
|
||||
PixelShader = compile ps_5_0 PS_MAIN_DIRECTIONAL();
|
||||
}
|
||||
|
||||
pass PointPass
|
||||
pass PointPass // 2
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
@@ -415,7 +483,7 @@ technique11 DefaultTechnique
|
||||
PixelShader = compile ps_5_0 PS_MAIN_POINT();
|
||||
}
|
||||
|
||||
pass CombinedPass
|
||||
pass CombinedPass // 3
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
@@ -425,7 +493,7 @@ technique11 DefaultTechnique
|
||||
PixelShader = compile ps_5_0 PS_MAIN_COMBINED();
|
||||
}
|
||||
|
||||
pass BlurPass
|
||||
pass BlurPass // 4
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
@@ -435,7 +503,7 @@ technique11 DefaultTechnique
|
||||
PixelShader = compile ps_5_0 PS_MAIN_BLUR_X();
|
||||
}
|
||||
|
||||
pass SpotPass
|
||||
pass SpotPass // 5
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
|
||||
@@ -50,7 +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(ClampSampler, In.vTexcoord);
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -29,7 +29,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
@@ -110,7 +110,7 @@
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>EDITOR_PROJECT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -136,7 +136,7 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>EDITOR_PROJECT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -157,29 +157,49 @@
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Camera_Debug.h" />
|
||||
<ClInclude Include="..\Public\Client_Define.h" />
|
||||
<ClInclude Include="..\Public\Client_Enum.h" />
|
||||
<ClInclude Include="..\Public\Client_Macro.h" />
|
||||
<ClInclude Include="..\Public\Client_Struct.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\InfoInstance.h" />
|
||||
<ClInclude Include="..\Public\Level_Field.h" />
|
||||
<ClInclude Include="..\Public\Level_GamePlay.h" />
|
||||
<ClInclude Include="..\Public\Level_Loading.h" />
|
||||
<ClInclude Include="..\Public\Level_Logo.h" />
|
||||
<ClInclude Include="..\Public\Level_Restart.h" />
|
||||
<ClInclude Include="..\Public\Light_Main.h" />
|
||||
<ClInclude Include="..\Public\Loader.h" />
|
||||
<ClInclude Include="..\Public\MainApp.h" />
|
||||
<ClInclude Include="..\Public\MapInfo.h" />
|
||||
<ClInclude Include="..\Public\MonsterInfo.h" />
|
||||
<ClInclude Include="..\Public\PlayerInfo.h" />
|
||||
<ClInclude Include="Client.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Camera_Debug.cpp" />
|
||||
<ClCompile Include="..\Private\InfoInstance.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Field.cpp" />
|
||||
<ClCompile Include="..\Private\Level_GamePlay.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Loading.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Logo.cpp" />
|
||||
<ClCompile Include="..\Private\Level_Restart.cpp" />
|
||||
<ClCompile Include="..\Private\Light_Main.cpp" />
|
||||
<ClCompile Include="..\Private\Loader.cpp" />
|
||||
<ClCompile Include="..\Private\MainApp.cpp" />
|
||||
<ClCompile Include="..\Private\MapInfo.cpp" />
|
||||
<ClCompile Include="..\Private\MonsterInfo.cpp" />
|
||||
<ClCompile Include="..\Private\pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\PlayerInfo.cpp" />
|
||||
<ClCompile Include="Client.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -37,6 +37,33 @@
|
||||
<ClInclude Include="..\Public\Level_GamePlay.h">
|
||||
<Filter>01.Levels\02.GamePlay</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Client_Struct.h">
|
||||
<Filter>99.Define</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\InfoInstance.h">
|
||||
<Filter>03.InfoInstance</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Level_Field.h">
|
||||
<Filter>01.Levels\10.Field</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Level_Restart.h">
|
||||
<Filter>01.Levels\99.Restart</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Debug.h">
|
||||
<Filter>02.GameObjects\Cameras\Debug</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Light_Main.h">
|
||||
<Filter>02.GameObjects\Environment\Lights\Main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\PlayerInfo.h">
|
||||
<Filter>03.InfoInstance\00.PlayerInfo</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\MonsterInfo.h">
|
||||
<Filter>03.InfoInstance\01.MonsterInfo</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\MapInfo.h">
|
||||
<Filter>03.InfoInstance\02.MapInfo</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -74,9 +101,6 @@
|
||||
<Filter Include="02.GameObjects">
|
||||
<UniqueIdentifier>{27434478-691e-42a8-83c7-ecd1a60f46ce}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="03.Information">
|
||||
<UniqueIdentifier>{cdfbb346-6cae-4094-93cd-b82685efa68e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras">
|
||||
<UniqueIdentifier>{7efd65d5-eb4d-4331-a746-f0fa2de6275b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -98,6 +122,78 @@
|
||||
<Filter Include="02.GameObjects\NPC\Ally">
|
||||
<UniqueIdentifier>{a7d0a3fa-b3dc-40c6-b258-ffcde49b05c1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic">
|
||||
<UniqueIdentifier>{b5bef783-5315-4488-ac64-cb98d16a84a9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\Item">
|
||||
<UniqueIdentifier>{31681680-d5de-43c9-bc2d-2c91ca58a593}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State">
|
||||
<UniqueIdentifier>{1bfec6dc-f008-4d18-87d6-be38824b1272}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\NPC">
|
||||
<UniqueIdentifier>{3eb21e8e-e01c-47fe-828e-800212456eb5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\PLAYER">
|
||||
<UniqueIdentifier>{9f952e5a-835c-4de9-b7b5-9a731912774d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\Skill">
|
||||
<UniqueIdentifier>{c5b61cb3-bc5f-4429-8715-b309dcf054b2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Levels\10.Field">
|
||||
<UniqueIdentifier>{2b209526-b728-4fba-a184-b9224d72903a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Levels\99.Restart">
|
||||
<UniqueIdentifier>{e12b3048-dd6d-41bf-b346-e4abdaa4f215}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Lights">
|
||||
<UniqueIdentifier>{74f21f9b-30bf-412e-ba4e-526958ab2a52}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\Debug">
|
||||
<UniqueIdentifier>{8d89a59c-fbd2-4a4a-ab01-a70abb80cc49}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\Shoulder">
|
||||
<UniqueIdentifier>{708bbc88-47fb-42c5-b060-14cec7d646f2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Lights\Main">
|
||||
<UniqueIdentifier>{b24c78ef-dccc-41f0-a086-053ae6b7fbf4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Plane">
|
||||
<UniqueIdentifier>{603938cc-e4fe-44d8-890b-784174a86161}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Player">
|
||||
<UniqueIdentifier>{11250d84-e19c-4999-a5d6-d9f89123e7ae}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster">
|
||||
<UniqueIdentifier>{b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Prop">
|
||||
<UniqueIdentifier>{2814c935-13d9-4b9a-94ba-c9e470219a18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Prop\SkyBox">
|
||||
<UniqueIdentifier>{19ee2ea4-2d79-46bd-b857-c759e3ec6cf4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Prop\SkyBox\TriggerBox">
|
||||
<UniqueIdentifier>{2561df42-3dfa-4045-a30c-85f44cd65e09}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\CameraPosition">
|
||||
<UniqueIdentifier>{25ad4a41-5b06-4659-bd29-c0c4265a3277}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\CameraPosition\Player">
|
||||
<UniqueIdentifier>{5a667a7b-6c90-44f6-9c9f-aac3108b6561}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="03.InfoInstance">
|
||||
<UniqueIdentifier>{cdfbb346-6cae-4094-93cd-b82685efa68e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="03.InfoInstance\00.PlayerInfo">
|
||||
<UniqueIdentifier>{1cfdfc05-0b0d-4c58-8c2d-58090efea4fd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="03.InfoInstance\01.MonsterInfo">
|
||||
<UniqueIdentifier>{621b87a7-54b8-4d90-84b2-fa8cd26cc396}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="03.InfoInstance\02.MapInfo">
|
||||
<UniqueIdentifier>{413e6692-6e4a-4b00-8306-edf652bd876a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -121,6 +217,30 @@
|
||||
<ClCompile Include="..\Private\Level_GamePlay.cpp">
|
||||
<Filter>01.Levels\02.GamePlay</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\InfoInstance.cpp">
|
||||
<Filter>03.InfoInstance</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Level_Field.cpp">
|
||||
<Filter>01.Levels\10.Field</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Level_Restart.cpp">
|
||||
<Filter>01.Levels\99.Restart</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Debug.cpp">
|
||||
<Filter>02.GameObjects\Cameras\Debug</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Light_Main.cpp">
|
||||
<Filter>02.GameObjects\Environment\Lights\Main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\PlayerInfo.cpp">
|
||||
<Filter>03.InfoInstance\00.PlayerInfo</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\MonsterInfo.cpp">
|
||||
<Filter>03.InfoInstance\01.MonsterInfo</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\MapInfo.cpp">
|
||||
<Filter>03.InfoInstance\02.MapInfo</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
#include "pch.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Shader.h"
|
||||
|
||||
CCamera_Debug::CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CCamera(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs)
|
||||
: CCamera(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamera_Debug::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CCamera_Debug::Update(_float fTimeDelta)
|
||||
{
|
||||
Transition(fTimeDelta);
|
||||
_float3 vCamPos = {};
|
||||
XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
GUI::Text("Cam Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z);
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
}
|
||||
if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) {
|
||||
m_pGameInstance->Toggle_MouseCenter();
|
||||
}
|
||||
if (m_bMovable) {
|
||||
#pragma region Position
|
||||
_float fSpeed = 5.f;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)) {
|
||||
m_pTransformCom->Go_Straight(fTimeDelta * fSpeed);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) {
|
||||
m_pTransformCom->Go_Left(fTimeDelta * fSpeed);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S)) {
|
||||
m_pTransformCom->Go_Backward(fTimeDelta * fSpeed);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) {
|
||||
m_pTransformCom->Go_Right(fTimeDelta * fSpeed);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_SPACE)) {
|
||||
m_pTransformCom->Go_Up(fTimeDelta * fSpeed);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_C)) {
|
||||
m_pTransformCom->Go_Down(fTimeDelta * fSpeed);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_TAB)) {
|
||||
Set_InitialPos();
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
#pragma region Angle
|
||||
|
||||
_float3 fMove = m_pGameInstance->Get_MouseMove();
|
||||
m_pTransformCom->Turn(XMVectorSet(0.f, 1.f, 0.f, 0.f), fTimeDelta * fMove.x * m_fMouseSensor);
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::RIGHT), fTimeDelta * fMove.y * m_fMouseSensor);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
__super::Bind_Matrices();
|
||||
}
|
||||
|
||||
void CCamera_Debug::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Initialize(void* pArg)
|
||||
{
|
||||
CAMERA_DEBUG_DESC* pDesc = static_cast<CAMERA_DEBUG_DESC*>(pArg);
|
||||
m_fMouseSensor = pDesc->fMouseSensor;
|
||||
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vEye), 1.f));
|
||||
m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f));
|
||||
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
|
||||
m_bActive = true;
|
||||
|
||||
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
|
||||
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CCamera_Debug::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CCamera_Debug::Set_InitialPos()
|
||||
{
|
||||
m_pTransformCom->Set_WorldMatrix(m_matInitial);
|
||||
}
|
||||
|
||||
CCamera_Debug* CCamera_Debug::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CCamera_Debug* pInstance = new CCamera_Debug(pDevice, pContext);
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CCamera_Debug");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CCamera_Debug* CCamera_Debug::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CCamera_Debug* pInstance = new CCamera_Debug(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CCamera_Debug");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CCamera_Debug::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CCamera_Debug::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
#include "pch.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "GameInstance.h"
|
||||
#include "MapInfo.h"
|
||||
#include "MonsterInfo.h"
|
||||
#include "PlayerInfo.h"
|
||||
|
||||
IMPLEMENT_SINGLETON(CInfoInstance)
|
||||
|
||||
CInfoInstance::CInfoInstance()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void CInfoInstance::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LEVEL CInfoInstance::Get_RestartLevel()
|
||||
{
|
||||
return LEVEL::GAMEPLAY;
|
||||
}
|
||||
|
||||
HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
m_pDevice = pDevice;
|
||||
m_pContext = pContext;
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
m_pMapInfo = CMapInfo::Create(pDevice, pContext);
|
||||
if (nullptr == m_pMapInfo) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pPlayerInfo = CPlayerInfo::Create(pDevice, pContext);
|
||||
if (nullptr == m_pPlayerInfo) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pMonsterInfo = CMonsterInfo::Create(pDevice, pContext);
|
||||
if (nullptr == m_pMonsterInfo) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CInfoInstance::Release_Information()
|
||||
{
|
||||
DestroyInstance();
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pMapInfo);
|
||||
SAFE_RELEASE(m_pPlayerInfo);
|
||||
SAFE_RELEASE(m_pMonsterInfo);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
void CInfoInstance::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
#include "pch.h"
|
||||
#include "Level_Field.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Light_Main.h"
|
||||
#include "Layer.h"
|
||||
|
||||
CLevel_Field::CLevel_Field(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(Ready_Lights())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Markers())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Layer_UI(LAYER_UI))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Layer_Effect(LAYER_EFFECT))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Initialize()
|
||||
{
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CLevel_Field::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Mouse_Up(DIM_RBUTTON))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::RESTART)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("필드레벨"));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Ready_Lights()
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLight_Main>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Ready_Layer_Camera()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Ready_Layer_Sound()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Ready_Markers()
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_Field::Ready_Layer_Effect(const _wstring& strLayerTag)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
pair<CLevel*, function<void()>> CLevel_Field::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg)
|
||||
{
|
||||
CLevel_Field* pInstance = new CLevel_Field(pDevice, pContext, eLevelID);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CLevel_Field");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return { pInstance, [pInstance]() { pInstance->Ready_Layer_Camera(); pInstance->Ready_Layer_Sound(); } };
|
||||
}
|
||||
|
||||
void CLevel_Field::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
}
|
||||
@@ -2,12 +2,16 @@
|
||||
#include "Level_GamePlay.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "Light_Main.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Layer.h"
|
||||
|
||||
CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
@@ -15,7 +19,6 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Lights())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Markers())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -37,10 +40,17 @@ HRESULT CLevel_GamePlay::Initialize()
|
||||
|
||||
void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Mouse_Up(DIM_RBUTTON))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
//if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::WOODS)))) {
|
||||
// return;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,19 +62,9 @@ HRESULT CLevel_GamePlay::Render()
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Lights()
|
||||
{
|
||||
LIGHT_DESC LightDesc{};
|
||||
|
||||
LightDesc.eType = LIGHT::DIRECTIONAL;
|
||||
LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f);
|
||||
LightDesc.vAmbient = _float4(0.2f, 0.2f, 0.2f, 0.f);
|
||||
LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
|
||||
//LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f);
|
||||
|
||||
//if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
assert(false);
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLight_Main>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -76,6 +76,28 @@ HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Camera()
|
||||
{
|
||||
CCamera_Debug::CAMERA_DEBUG_DESC Camera_Desc{};
|
||||
Camera_Desc.fFovy = XMConvertToRadians(60.0f);
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 200.f;
|
||||
Camera_Desc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
Camera_Desc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
Camera_Desc.fSpeedPerSec = 5.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 99;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
CCamera_Debug* pCamera = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CCamera_Debug>(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))){
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -112,4 +134,5 @@ void CLevel_GamePlay::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_Loading.h"
|
||||
|
||||
#include "Loader.h"
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Layer.h"
|
||||
#include "Level_Logo.h"
|
||||
#include "Level_GamePlay.h"
|
||||
#include "Level_Restart.h"
|
||||
#include "Level_Field.h"
|
||||
|
||||
CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -47,7 +49,17 @@ void CLevel_Loading::Update(_float fTimeDelta)
|
||||
{
|
||||
pairLevel = CLevel_GamePlay::Create(m_pDevice, m_pContext, m_eNextLevelID, nullptr);
|
||||
} break;
|
||||
case LEVEL::FIELD:
|
||||
{
|
||||
pairLevel = CLevel_Field::Create(m_pDevice, m_pContext, m_eNextLevelID, nullptr);
|
||||
} break;
|
||||
case LEVEL::RESTART:
|
||||
{
|
||||
pairLevel = CLevel_Restart::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
} break;
|
||||
|
||||
default:
|
||||
assert(false); // E_IMPL
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -59,7 +71,7 @@ void CLevel_Loading::Update(_float fTimeDelta)
|
||||
return;
|
||||
}
|
||||
else /* FAILED */ {
|
||||
assert(false); // 레벨 변경 실패
|
||||
assert(false); // 레벨 변경 실패
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_Logo.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
|
||||
CLevel_Logo::CLevel_Logo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
}
|
||||
|
||||
HRESULT CLevel_Logo::Initialize()
|
||||
@@ -23,6 +25,12 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Mouse_Up(DIM_RBUTTON))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::GAMEPLAY)))) {
|
||||
return;
|
||||
}
|
||||
@@ -31,7 +39,7 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_Logo::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("로고레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("로고레벨입니다"));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -57,5 +65,5 @@ void CLevel_Logo::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#include "pch.h"
|
||||
#include "Level_Restart.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
|
||||
|
||||
|
||||
CLevel_Restart::CLevel_Restart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
}
|
||||
|
||||
HRESULT CLevel_Restart::Initialize()
|
||||
{
|
||||
m_eNextLevel = m_pInfoInstance->Get_RestartLevel();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CLevel_Restart::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Mouse_Up(DIM_RBUTTON))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, m_eNextLevel)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CLevel_Restart::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("리스타트레벨"));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
pair<CLevel*, function<void()>> CLevel_Restart::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
{
|
||||
CLevel_Restart* pInstance = new CLevel_Restart(pDevice, pContext, eLevelID);
|
||||
|
||||
if (FAILED(pInstance->Initialize()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CLevel_Restart");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return { pInstance, nullptr };
|
||||
}
|
||||
|
||||
void CLevel_Restart::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
#include "pch.h"
|
||||
#include "Light_Main.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CLight_Main::CLight_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CLight_Main::CLight_Main(const CLight_Main& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CLight_Main::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLight_Main::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CLight_Main::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CLight_Main::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CLight_Main::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CLight_Main::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLight_Main::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components(nullptr);
|
||||
|
||||
LIGHT_DESC LightDesc{};
|
||||
|
||||
LightDesc.eType = LIGHT::DIRECTIONAL;
|
||||
LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f);
|
||||
LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f);
|
||||
LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
|
||||
LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK);
|
||||
LightDesc.iLevel = NEXT_LEVEL;
|
||||
|
||||
/* Com_Light*/
|
||||
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &LightDesc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLight_Main::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CLight_Main* CLight_Main::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CLight_Main* pInstance = new CLight_Main(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CLight_Main");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CLight_Main::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CLight_Main* pInstance = new CLight_Main(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CLight_Main");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CLight_Main::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pLightCom);
|
||||
}
|
||||
|
||||
void CLight_Main::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Loader.h"
|
||||
#include "GameInstance.h"
|
||||
#include "MainApp.h"
|
||||
#include "Light_Main.h"
|
||||
#include "Camera_Debug.h"
|
||||
|
||||
CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: m_pDevice{ pDevice }
|
||||
@@ -29,11 +31,7 @@ HRESULT CLoader::Initialize(LEVEL eNextLevelID)
|
||||
{
|
||||
m_eNextLevelID = eNextLevelID;
|
||||
|
||||
InitializeCriticalSection(&m_CriticalSection);
|
||||
|
||||
m_hThread = (HANDLE)_beginthreadex(nullptr, 0, LoadingMain, this, 0, nullptr);
|
||||
if (0 == m_hThread)
|
||||
return E_FAIL;
|
||||
m_pGameInstance->EnqueueJob(&LoadingMain, this);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -45,8 +43,6 @@ HRESULT CLoader::Loading()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
EnterCriticalSection(&m_CriticalSection);
|
||||
|
||||
HRESULT hr = {};
|
||||
|
||||
switch (m_eNextLevelID)
|
||||
@@ -57,14 +53,21 @@ HRESULT CLoader::Loading()
|
||||
case LEVEL::GAMEPLAY:
|
||||
hr = Loading_For_GamePlay();
|
||||
break;
|
||||
case LEVEL::FIELD:
|
||||
hr = Loading_For_Field();
|
||||
break;
|
||||
case LEVEL::RESTART:
|
||||
hr = Loading_For_Restart();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&m_CriticalSection);
|
||||
CoUninitialize();
|
||||
|
||||
if (FAILED(hr))
|
||||
if (FAILED(hr)){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -76,17 +79,25 @@ void CLoader::Output()
|
||||
|
||||
HRESULT CLoader::Loading_For_Logo()
|
||||
{
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("사운드를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("사운드를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CCamera_Debug>(g_iStaticLevel, CCamera_Debug::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CLight_Main>(g_iStaticLevel, CLight_Main::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
@@ -95,19 +106,61 @@ HRESULT CLoader::Loading_For_Logo()
|
||||
|
||||
HRESULT CLoader::Loading_For_GamePlay()
|
||||
{
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("정보를 불러오는 중입니다.");
|
||||
m_strMessage = TEXT("정보를 불러오는 중입니다.");
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Loading_For_Field()
|
||||
{
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("정보를 불러오는 중입니다.");
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Loading_For_Restart()
|
||||
{
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("정보를 불러오는 중입니다.");
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
@@ -132,11 +185,6 @@ void CLoader::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
WaitForSingleObject(m_hThread, INFINITE);
|
||||
|
||||
CloseHandle(m_hThread);
|
||||
|
||||
DeleteCriticalSection(&m_CriticalSection);
|
||||
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "MainApp.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
_float g_fTimeMult = 1.f;
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
CMainApp::CMainApp()
|
||||
: m_pGameInstance{ CGameInstance::GetInstance() }
|
||||
{
|
||||
@@ -74,7 +74,7 @@ HRESULT CMainApp::Render()
|
||||
|
||||
m_pGameInstance->Draw();
|
||||
GUI::Render();
|
||||
//m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("피곤해 못 써"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f));
|
||||
//m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("피곤해 못 써"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f));
|
||||
ImGui_ImplDX11_RenderDrawData(GUI::GetDrawData());
|
||||
m_pGameInstance->Render_End();
|
||||
|
||||
@@ -96,7 +96,14 @@ HRESULT CMainApp::Start_Level(LEVEL eLevelID)
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, eLevelID)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
if (nullptr == m_pInfoInstance) {
|
||||
return E_FAIL;
|
||||
}
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
if (FAILED(m_pInfoInstance->Initialize_Information(m_pDevice, m_pContext))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -157,6 +164,9 @@ void CMainApp::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
m_pInfoInstance->Release_Information();
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
|
||||
Release_IMGUI();
|
||||
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#include "pch.h"
|
||||
#include "MapInfo.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
CMapInfo::CMapInfo()
|
||||
{
|
||||
}
|
||||
|
||||
void CMapInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
m_pDevice = pDevice;
|
||||
m_pContext = pContex;
|
||||
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CMapInfo* CMapInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
CMapInfo* pInstance = new CMapInfo();
|
||||
|
||||
if (FAILED(pInstance->Initialize(pDevice, pContex))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CMapInfo::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
#include "pch.h"
|
||||
#include "MonsterInfo.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
CMonsterInfo::CMonsterInfo()
|
||||
{
|
||||
}
|
||||
|
||||
void CMonsterInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
m_pDevice = pDevice;
|
||||
m_pContext = pContex;
|
||||
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CMonsterInfo* CMonsterInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
CMonsterInfo* pInstance = new CMonsterInfo();
|
||||
|
||||
if (FAILED(pInstance->Initialize(pDevice, pContex))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CMonsterInfo::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
#include "pch.h"
|
||||
#include "PlayerInfo.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
CPlayerInfo::CPlayerInfo()
|
||||
{
|
||||
}
|
||||
|
||||
void CPlayerInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CPlayerInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
m_pInfoInstance = CInfoInstance::GetInstance();
|
||||
m_pDevice = pDevice;
|
||||
m_pContext = pContex;
|
||||
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CPlayerInfo* CPlayerInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
CPlayerInfo* pInstance = new CPlayerInfo();
|
||||
|
||||
if (FAILED(pInstance->Initialize(pDevice, pContex))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CPlayerInfo::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Camera.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCamera_Debug final : public CCamera
|
||||
{
|
||||
public:
|
||||
typedef struct tagCamera_Debug : public CCamera::CAMERA_DESC
|
||||
{
|
||||
_float3 vEye{}, vAt{};
|
||||
_float fMouseSensor{};
|
||||
}CAMERA_DEBUG_DESC;
|
||||
|
||||
private:
|
||||
CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CCamera_Debug(const CCamera_Debug& rhs);
|
||||
virtual ~CCamera_Debug() = default;
|
||||
|
||||
public:
|
||||
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:
|
||||
_bool m_bMovable = true;
|
||||
_float m_fMouseSensor = {};
|
||||
_float4x4 m_matInitial = {};
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
void Set_InitialPos();
|
||||
|
||||
public:
|
||||
static CCamera_Debug* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamera_Debug* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <process.h>
|
||||
#include "../Default/framework.h"
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
namespace Client
|
||||
{
|
||||
const unsigned int g_iWinSizeX = 1920;
|
||||
const unsigned int g_iWinSizeY = 1080;
|
||||
const unsigned int g_iWinSizeX = 1920;
|
||||
const unsigned int g_iWinSizeY = 1080;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
namespace Client
|
||||
{
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, END };
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, INTRO, GAMEPLAY, FIELD, RESTART, END };
|
||||
enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END };
|
||||
enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT };
|
||||
|
||||
enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END };
|
||||
enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END };
|
||||
enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, END };
|
||||
enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, END };
|
||||
enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END };
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
|
||||
}
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END };
|
||||
|
||||
enum class EFFECT_TYPE { EFFECT, TRAIL, END };
|
||||
}
|
||||
|
||||
@@ -15,9 +15,10 @@ namespace Client {
|
||||
#define FX_POSTEX TEXT("FX_POSTEX")
|
||||
#define FX_NORTEX TEXT("FX_NORTEX")
|
||||
#define FX_CELL TEXT("FX_CELL")
|
||||
#define FX_DEFERRED TEXT("FX_DEFFERED")
|
||||
#define FX_PARTICLE TEXT("FX_PARTICLE")
|
||||
#define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL")
|
||||
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
|
||||
#define FX_UIINSTANCE TEXT("FX_UIINSTANCE")
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MACRO_PROTOTYPE
|
||||
@@ -27,6 +28,7 @@ namespace Client {
|
||||
#pragma endregion
|
||||
#pragma region OBJECT
|
||||
|
||||
#define CAMERA_DEBUG TEXT("CAMERA_DEBUG")
|
||||
#pragma endregion
|
||||
#pragma region COMPONENT
|
||||
|
||||
@@ -49,7 +51,9 @@ namespace Client {
|
||||
#define LAYER_DOT TEXT("Layer_Dot")
|
||||
#define LAYER_CELL TEXT("Layer_Cell")
|
||||
#define LAYER_TRIGGER TEXT("Layer_Trigger")
|
||||
#define LAYER_LIGHT TEXT("Layer_Light")
|
||||
|
||||
#define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager")
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MACRO_TEXTURE
|
||||
@@ -58,4 +62,4 @@ namespace Client {
|
||||
#pragma region MACRO_EXTRA
|
||||
|
||||
#pragma endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CInfoInstance final : public CBase
|
||||
{
|
||||
DECLARE_SINGLETON(CInfoInstance)
|
||||
private:
|
||||
CInfoInstance();
|
||||
virtual ~CInfoInstance() = default;
|
||||
public:
|
||||
HRESULT Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
void Release_Information();
|
||||
LEVEL Get_RestartLevel();
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
class CPlayerInfo* m_pPlayerInfo = { nullptr };
|
||||
class CMonsterInfo* m_pMonsterInfo = { nullptr };
|
||||
class CMapInfo* m_pMapInfo = { nullptr };
|
||||
|
||||
#ifdef _DEBUG
|
||||
_string m_strLog = {};
|
||||
#endif // _DEBUG
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CLevel_Field final : public CLevel
|
||||
{
|
||||
private:
|
||||
CLevel_Field(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual ~CLevel_Field() = default;
|
||||
|
||||
public:
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Initialize(void* pArg);
|
||||
HRESULT Ready_Lights();
|
||||
HRESULT Ready_Markers();
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Camera();
|
||||
HRESULT Ready_Layer_Sound();
|
||||
HRESULT Ready_Layer_Effect(const _wstring& strLayerTag);
|
||||
|
||||
public:
|
||||
static pair<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
@@ -16,6 +16,10 @@ class CLevel_GamePlay final : public CLevel
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Initialize(void* pArg);
|
||||
@@ -25,10 +29,11 @@ class CLevel_GamePlay final : public CLevel
|
||||
HRESULT Ready_Layer_Camera();
|
||||
HRESULT Ready_Layer_Sound();
|
||||
HRESULT Ready_Layer_Effect(const _wstring& strLayerTag);
|
||||
|
||||
|
||||
public:
|
||||
static pair<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
@@ -15,6 +15,9 @@ class CLevel_Logo final : public CLevel
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
@@ -25,4 +28,4 @@ class CLevel_Logo final : public CLevel
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
NS_BEGIN(Client)
|
||||
|
||||
|
||||
class CLevel_Restart final : public CLevel
|
||||
{
|
||||
private:
|
||||
CLevel_Restart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual ~CLevel_Restart() = default;
|
||||
|
||||
public:
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
|
||||
private:
|
||||
LEVEL m_eNextLevel = {};
|
||||
public:
|
||||
static pair<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CLight;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CLight_Main final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CLight_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CLight_Main(const CLight_Main& Prototype);
|
||||
virtual ~CLight_Main() = default;
|
||||
|
||||
public:
|
||||
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:
|
||||
CLight* m_pLightCom = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CLight_Main* 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,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Base.h"
|
||||
@@ -27,8 +27,6 @@ class CLoader final : public CBase
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
LEVEL m_eNextLevelID = { LEVEL::END };
|
||||
|
||||
HANDLE m_hThread = {};
|
||||
CRITICAL_SECTION m_CriticalSection = {};
|
||||
_wstring m_strMessage = {};
|
||||
_bool m_isFinished = { false };
|
||||
|
||||
@@ -36,6 +34,8 @@ class CLoader final : public CBase
|
||||
HRESULT Initialize(LEVEL eNextLevelID);
|
||||
HRESULT Loading_For_Logo();
|
||||
HRESULT Loading_For_GamePlay();
|
||||
HRESULT Loading_For_Field();
|
||||
HRESULT Loading_For_Restart();
|
||||
|
||||
public:
|
||||
static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID);
|
||||
@@ -43,4 +43,4 @@ class CLoader final : public CBase
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Base.h"
|
||||
@@ -23,6 +23,7 @@ class CMainApp final : public CBase
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMapInfo final : public CBase
|
||||
{
|
||||
private:
|
||||
CMapInfo();
|
||||
~CMapInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
|
||||
public:
|
||||
static CMapInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMonsterInfo final : public CBase
|
||||
{
|
||||
private:
|
||||
CMonsterInfo();
|
||||
~CMonsterInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
|
||||
public:
|
||||
static CMonsterInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Base.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CPlayerInfo final : public CBase
|
||||
{
|
||||
private:
|
||||
CPlayerInfo();
|
||||
~CPlayerInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
|
||||
public:
|
||||
static CPlayerInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 4.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 83 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user