This commit is contained in:
qordlsgur
2025-11-17 12:04:28 +09:00
1138 changed files with 11651 additions and 567 deletions
@@ -157,6 +157,52 @@ BlendState BS_UIBlend
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;
SrcBlend[2] = one;
DestBlend[2] = one;
BlendOp[2] = Add;
};
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;
@@ -57,31 +57,9 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
discard;
}
int iOption = vColorTexture.a * 10;
Out.vBackBuffer = vColorTexture;
switch (iOption)
{
case 1:
Out.vBackBuffer.rgb /= vColorTexture.rgb;
break;
case 2:
Out.vBackBuffer.rgb += vColorTexture.rgb;
break;
case 3:
Out.vBackBuffer.rgb -= vColorTexture.rgb;
break;
case 4:
Out.vBackBuffer.rgb *= vColorTexture.rgb;
break;
case 5:
Out.vBackBuffer.rgb = vColorTexture.rgb;
break;
default:
break;
}
return Out;
}
@@ -21,10 +21,13 @@ struct ParticleValue
float2 vMaskingUVMoveTime;
float2 vDiffuseUVMoveTime;
float2 vDistortionUVMoveTime;
float2 vNoiseUVMoveTime;
float2 vAniTime;
float2 vAniIndex;
};
@@ -99,7 +102,7 @@ void CS_MAIN(
}
particle.vLifeTime.x = 0.f;
particle.vTranslation.y = 0.f;
}
Billboard(particle);
@@ -0,0 +1,82 @@
#include "Engine_Shader_Defines.hlsli"
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
Texture2D g_MixedDiffuseTexture;
Texture2D g_RevealageTexture;
struct VS_IN
{
float3 vPosition : POSITION;
float2 vTexcoord : TEXCOORD0;
};
struct VS_OUT
{
float4 vPosition : SV_POSITION;
float2 vTexcoord : TEXCOORD0;
};
VS_OUT VS_MAIN(VS_IN In)
{
VS_OUT Out;
matrix matWV, matWVP;
matWV = mul(g_WorldMatrix, g_ViewMatrix);
matWVP = mul(matWV, g_ProjMatrix);
Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP);
Out.vTexcoord = In.vTexcoord;
return Out;
}
struct PS_IN
{
float4 vPosition : SV_POSITION;
float2 vTexcoord : TEXCOORD0;
};
struct PS_OUT
{
float4 vBackBuffer : SV_TARGET0;
};
PS_OUT PS_MAIN(PS_IN In)
{
PS_OUT Out;
vector vMixedDiffuse = g_MixedDiffuseTexture.Sample(PointSampler, In.vTexcoord);
float fRevealage = g_RevealageTexture.Sample(PointSampler, In.vTexcoord);
Out.vBackBuffer = vector(vMixedDiffuse.rgb / fRevealage , fRevealage);
//float fClamp;
//fClamp = clamp(vMixedDiffuse.a, 1e-4, 5e4);
//Out.vBackBuffer = vector(vMixedDiffuse.rgb / fClamp, fRevealage);
return Out;
}
technique11 DefaultTechnique
{
pass WeightBlend
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_None, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MAIN();
}
}
@@ -208,6 +208,7 @@ call Update_Lib.bat
<ClCompile Include="..\Private\ContainerObject.cpp" />
<ClCompile Include="..\Private\DebugDraw.cpp" />
<ClCompile Include="..\private\ElementObject.cpp" />
<ClCompile Include="..\Private\FSM.cpp" />
<ClCompile Include="..\Private\GameInstance.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</ExcludedFromBuild>
@@ -291,6 +292,7 @@ call Update_Lib.bat
<ClCompile Include="..\Private\Shader.cpp" />
<ClCompile Include="..\Private\Shadow.cpp" />
<ClCompile Include="..\Private\SoundSrc.cpp" />
<ClCompile Include="..\Private\State.cpp" />
<ClCompile Include="..\Private\Texture.cpp" />
<ClCompile Include="..\Private\Timer.cpp" />
<ClCompile Include="..\Private\Timer_Manager.cpp" />
@@ -300,6 +302,7 @@ call Update_Lib.bat
<ClCompile Include="..\Private\Transform.cpp" />
<ClCompile Include="..\private\UIComponent.cpp" />
<ClCompile Include="..\private\UIObject.cpp" />
<ClCompile Include="..\Private\Unit.cpp" />
<ClCompile Include="..\Private\VIBuffer.cpp" />
<ClCompile Include="..\Private\VIBuffer_Cell.cpp" />
<ClCompile Include="..\Private\VIBuffer_Cube.cpp" />
@@ -409,6 +412,7 @@ call Update_Lib.bat
<ClInclude Include="..\Public\Bounding_AABB.h" />
<ClInclude Include="..\Public\Bounding_OBB.h" />
<ClInclude Include="..\Public\Bounding_Sphere.h" />
<ClInclude Include="..\public\FSM.h" />
<ClInclude Include="..\Public\NCallBack_Playable_Behavior.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
@@ -526,6 +530,7 @@ call Update_Lib.bat
<ClInclude Include="..\Public\Shader.h" />
<ClInclude Include="..\Public\Shadow.h" />
<ClInclude Include="..\Public\SoundSrc.h" />
<ClInclude Include="..\Public\State.h" />
<ClInclude Include="..\Public\Texture.h" />
<ClInclude Include="..\Public\Timer.h" />
<ClInclude Include="..\Public\Timer_Manager.h" />
@@ -533,6 +538,7 @@ call Update_Lib.bat
<ClInclude Include="..\Public\Transform.h" />
<ClInclude Include="..\public\UIComponent.h" />
<ClInclude Include="..\public\UIObject.h" />
<ClInclude Include="..\Public\Unit.h" />
<ClInclude Include="..\Public\VIBuffer.h" />
<ClInclude Include="..\Public\VIBuffer_Cell.h" />
<ClInclude Include="..\Public\VIBuffer_Cube.h" />
@@ -561,6 +567,10 @@ call Update_Lib.bat
<None Include="..\Public\fMod\fmod_errors.cs" />
</ItemGroup>
<ItemGroup>
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_WeightBlend.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Effect</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
</FxCompile>
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_LastColor.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Effect</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
@@ -256,6 +256,15 @@
<Filter Include="02.Element\02.Component\08.Character_Controller\CallBack">
<UniqueIdentifier>{05865481-fa20-4432-a5a7-945d4f8c7f3c}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\10.FSM">
<UniqueIdentifier>{0014599a-3877-4fe8-b32f-1dafc3753c6b}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\10.FSM\State">
<UniqueIdentifier>{cf6beeeb-6caa-46ef-b9d9-3b1daf43a7f1}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\01.GameObject\Unit">
<UniqueIdentifier>{a4560f1b-c4f4-4705-bbf8-6a60977d3211}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\01.GameObject\00.ContainerObject\01.PartObject">
<UniqueIdentifier>{b3742605-653a-4bdf-bad9-329d993e7f52}</UniqueIdentifier>
</Filter>
@@ -489,6 +498,15 @@
<ClCompile Include="..\Public\NCallBack_Playable_Behavior.cpp">
<Filter>02.Element\02.Component\08.Character_Controller\CallBack</Filter>
</ClCompile>
<ClCompile Include="..\Private\FSM.cpp">
<Filter>02.Element\02.Component\10.FSM</Filter>
</ClCompile>
<ClCompile Include="..\Private\State.cpp">
<Filter>02.Element\02.Component\10.FSM\State</Filter>
</ClCompile>
<ClCompile Include="..\Private\Unit.cpp">
<Filter>02.Element\01.GameObject\Unit</Filter>
</ClCompile>
<ClCompile Include="..\private\VIBuffer_UI_Instance.cpp">
<Filter>02.Element\02.Component\02.VIBuffer\Instance\UI_nstance</Filter>
</ClCompile>
@@ -1088,6 +1106,15 @@
<ClInclude Include="..\Public\NCallBack_Playable_Behavior.h">
<Filter>02.Element\02.Component\08.Character_Controller\CallBack</Filter>
</ClInclude>
<ClInclude Include="..\public\FSM.h">
<Filter>02.Element\02.Component\10.FSM</Filter>
</ClInclude>
<ClInclude Include="..\Public\State.h">
<Filter>02.Element\02.Component\10.FSM\State</Filter>
</ClInclude>
<ClInclude Include="..\Public\Unit.h">
<Filter>02.Element\01.GameObject\Unit</Filter>
</ClInclude>
<ClInclude Include="..\public\VIBuffer_UI_Instance.h">
<Filter>02.Element\02.Component\02.VIBuffer\Instance\UI_nstance</Filter>
</ClInclude>
@@ -1158,5 +1185,8 @@
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_LastColor.hlsl">
<Filter>99.Define\01.SHADER</Filter>
</FxCompile>
<FxCompile Include="..\Bin\Resources\ShaderFiles\Shader_WeightBlend.hlsl">
<Filter>99.Define\01.SHADER</Filter>
</FxCompile>
</ItemGroup>
</Project>
+72 -8
View File
@@ -4,6 +4,7 @@
#include "Channel.h"
#include "Model.h"
#include "Transform.h"
#include "Bone.h"
CAnimation::CAnimation()
{
@@ -48,8 +49,11 @@ _bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bone
}
_uint iIndex = {};
if (m_vBoneTransformationMatrix.size() > 0)
m_vBoneTransformationMatrix.clear();
for (auto& pChannel : m_Channels) {
pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++],pTransform);
m_vBoneTransformationMatrix.push_back(pChannel->Get_BoneTransformationMatrix());
}
return false;
@@ -105,18 +109,78 @@ vector<_int>* CAnimation::Capture_Bones()
return &m_DestBones;
}
void CAnimation::Remap_Channels_By_Name(CModel* TargetModel)
void CAnimation::InterpAnim(CAnimation* pPreAnim, vector<CBone*>& Bones, float fRatio)
{
for (auto& channel : m_Channels)
if (!pPreAnim) return;
if (m_Channels.empty() || pPreAnim->m_Channels.empty()) return;
size_t CurCount = m_vBoneTransformationMatrix.size();
size_t PreCount = pPreAnim->m_vBoneTransformationMatrix.size();
if (CurCount == 0 || PreCount == 0)
return;
if (CurCount > PreCount)
{
const string& name = channel->Get_Name();
pPreAnim->m_vBoneTransformationMatrix.resize(CurCount, XMMatrixIdentity());
}
else if (CurCount < PreCount)
{
m_vBoneTransformationMatrix.resize(PreCount, XMMatrixIdentity());
}
int idx = TargetModel->Get_BoneIndex(name.c_str());
size_t Count = m_vBoneTransformationMatrix.size();
if (idx != -1)
channel->Set_BoneIndex(idx);
else
channel->Set_BoneIndex(-1);
unordered_map<_string, int> PreBoneMap;
PreBoneMap.reserve(pPreAnim->m_Channels.size());
for (size_t j = 0; j < pPreAnim->m_Channels.size(); j++)
{
PreBoneMap[pPreAnim->m_pSaveAnim->Channels[j].ChannelName] = (int)j;
}
for (size_t i = 0; i < m_Channels.size(); i++)
{
const _string& BoneName = m_pSaveAnim->Channels[i].ChannelName;
auto iter = PreBoneMap.find(BoneName);
if (iter == PreBoneMap.end())
{
_int BoneIndex = m_Channels[i]->Get_BoneIndex();
if (BoneIndex < Bones.size())
Bones[BoneIndex]->Set_TransformationMatrix(m_vBoneTransformationMatrix[i]);
continue;
}
int PreIndex = iter->second;
_matrix CurMat = m_vBoneTransformationMatrix[i];
_matrix PreMat = pPreAnim->m_vBoneTransformationMatrix[PreIndex];
_vector CurScale, CurRot, CurPos;
_vector PreScale, PreRot, PrePos;
XMMatrixDecompose(&CurScale, &CurRot, &CurPos, CurMat);
XMMatrixDecompose(&PreScale, &PreRot, &PrePos, PreMat);
_vector FinalScale = XMVectorLerp(PreScale, CurScale, fRatio);
_vector FinalRot = XMQuaternionSlerp(PreRot, CurRot, fRatio);
_vector FinalPos = XMVectorLerp(PrePos, CurPos, fRatio);
if (BoneName == "Reference")
{
FinalPos = XMVectorZero();
}
_matrix FinalMat = XMMatrixAffineTransformation(FinalScale, XMVectorZero(), FinalRot, FinalPos);
int BoneIndex = m_Channels[i]->Get_BoneIndex();
if (BoneIndex < Bones.size())
{
Bones[BoneIndex]->Set_TransformationMatrix(FinalMat);
}
m_vBoneTransformationMatrix[i] = FinalMat;
}
}
+5 -3
View File
@@ -154,7 +154,7 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, _float f
_vector vDeltaAdjusted = {};
XMMATRIX pre = XMLoadFloat4x4(&m_PreTransformMatrix);
vDeltaAdjusted = XMVector3TransformNormal(vDeltaLocal, pre*20.f);
vDeltaAdjusted = XMVector3TransformNormal(vDeltaLocal, pre);
_vector vRight = pTransform->Get_State(STATE::RIGHT);
_vector vUp = pTransform->Get_State(STATE::UP);
@@ -166,6 +166,8 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, _float f
_vector vDeltaWorld = vRight * dx + vUp * dz + vLook * dy;
vDeltaWorld *= 0.01f;
_vector vCurrentPos = pTransform->Get_State(STATE::POSITION);
_vector vTargetPos = vCurrentPos + vDeltaWorld;
@@ -175,9 +177,9 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, _float f
vTranslation = XMVectorZero();
}
_matrix BoneTransformationMatrix = XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
m_BoneTransformationMatrix = XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation);
Bones[m_iBoneIndex]->Set_TransformationMatrix(BoneTransformationMatrix);
Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix);
}
@@ -195,6 +195,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
m_tagData.pOwner = m_pOwner;
XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
m_tagData.pCharacter = this;
m_tagData.iSubKind = pDesc->iSubKind;
}
switch (m_eBodyType)
+95
View File
@@ -0,0 +1,95 @@
#include "pch.h"
#include "FSM.h"
#include "State.h"
CFSM::CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
:CComponent(pDevice, pContext)
{
m_States.resize(FSMSTATE::END);
}
CFSM::CFSM(const CFSM& rhs)
: CComponent(rhs),
m_States(rhs.m_States)
{
}
HRESULT CFSM::Initialize_Prototype()
{
return S_OK;
}
HRESULT CFSM::Initialize(void* pArg)
{
return S_OK;
}
void CFSM::Add_State(_uint iIndex, CState* state)
{
m_States[iIndex] = state;
m_States[iIndex]->Set_Owner(m_pOwner);
m_States[iIndex]->Set_Component();
}
void CFSM::Change_State(_uint iIndex)
{
if (m_pCurrent)
m_pCurrent->Exit();
m_pCurrent = m_States[iIndex];
if (m_pCurrent)
m_pCurrent->Enter();
}
void CFSM::Update(_float fTimeDelta)
{
if (m_pCurrent)
m_pCurrent->Update(fTimeDelta);
}
CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CFSM* pInstance = new CFSM(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CFSM");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CComponent* CFSM::Clone(void* pArg, class CGameObject* pOwner)
{
CFSM* pInstance = new CFSM(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CFSM");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CFSM::Free()
{
__super::Free();
SAFE_RELEASE(m_pCurrent);
for (auto& states : m_States)
{
SAFE_RELEASE(states);
}
m_States.clear();
}
void CFSM::Describe_Entity()
{
}
@@ -104,7 +104,7 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
m_pMouse_Manager->Update();
//m_pSound_Manager->Update();
//m_pPicking->Update();
m_pPicking->Update();
m_pObject_Manager->Priority_Update(fTimeDelta);
@@ -225,6 +225,11 @@ void CGameInstance::Render_End()
#endif // _DEBUG
}
HRESULT CGameInstance::Bind_DepthStencil(CShader* pShader, const _char* pContantName)
{
return m_pGraphic_Device->Bind_DepthStencil(pShader , pContantName);
}
_float CGameInstance::Get_TimeDelta(const _wstring& strTimerTag)
{
return m_pTimer_Manager->Get_TimeDelta(strTimerTag);
@@ -494,6 +499,11 @@ HRESULT CGameInstance::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, I
return m_pRenderTarget_Manager->Begin_MRT_Include_BackBuffer(strMRTTag, pDSV);
}
HRESULT CGameInstance::Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag)
{
return m_pRenderTarget_Manager->Begin_MRT_NO_DepthStencil(strMRTTag);
}
HRESULT CGameInstance::End_MRT()
{
return m_pRenderTarget_Manager->End_MRT();
@@ -1,5 +1,6 @@
#include "pch.h"
#include "Graphic_Device.h"
#include "Shader.h"
CGraphic_Device::CGraphic_Device()
: m_pDevice{ nullptr }
@@ -83,6 +84,14 @@ HRESULT CGraphic_Device::Present()
return m_pSwapChain->Present(0, 0);
}
HRESULT CGraphic_Device::Bind_DepthStencil(CShader* pShader, const _char* pContantName)
{
if (FAILED(pShader->Bind_SRV(pContantName, m_pDepthStencilSRV)))
return E_FAIL;
return S_OK;
}
HRESULT CGraphic_Device::Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY)
{
@@ -172,20 +181,37 @@ HRESULT CGraphic_Device::Ready_DepthStencilView(_uint iWinCX, _uint iWinCY)
TextureDesc.Height = iWinCY;
TextureDesc.MipLevels = 1;
TextureDesc.ArraySize = 1;
TextureDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
TextureDesc.Format = DXGI_FORMAT_R24G8_TYPELESS;
TextureDesc.SampleDesc.Quality = 0;
TextureDesc.SampleDesc.Count = 1;
TextureDesc.Usage = D3D11_USAGE_DEFAULT;
TextureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
TextureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
TextureDesc.CPUAccessFlags = 0;
TextureDesc.MiscFlags = 0;
if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &pDepthStencilTexture)))
return E_FAIL;
if (FAILED(m_pDevice->CreateDepthStencilView(pDepthStencilTexture, nullptr, &m_pDepthStencilView)))
D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc = {};
dsvDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
dsvDesc.Texture2D.MipSlice = 0;
if (FAILED(m_pDevice->CreateDepthStencilView(pDepthStencilTexture, &dsvDesc, &m_pDepthStencilView)))
return E_FAIL;
/* DepthStencil SRV */
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
srvDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS; // 뎁스 샘플링용
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srvDesc.Texture2D.MipLevels = 1;
srvDesc.Texture2D.MostDetailedMip = 0;
if(FAILED(m_pDevice->CreateShaderResourceView(pDepthStencilTexture, &srvDesc, &m_pDepthStencilSRV)))
return E_FAIL;
SAFE_RELEASE(pDepthStencilTexture);
@@ -212,6 +238,7 @@ void CGraphic_Device::Free()
SAFE_RELEASE(m_pDepthStencilView);
SAFE_RELEASE(m_pBackBufferRTV);
SAFE_RELEASE(m_pDeviceContext);
SAFE_RELEASE(m_pDepthStencilSRV);
#if defined(DEBUG) || defined(_DEBUG)
ID3D11Debug* d3dDebug;
@@ -540,6 +540,12 @@ void CInstance_Model::Describe_Entity()
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("DistortionUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDistortionUVMoveTime)))
{
Instane_Buffer_ReStruct();
}
if (ImGui::DragFloat2("NoiseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vNoiseUVMoveTime)))
{
Instane_Buffer_ReStruct();
@@ -252,20 +252,32 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
/* Find type */
if (!strcmp(FileType.c_str(), "D"))
eTexture = aiTextureType::aiTextureType_DIFFUSE;
else if (!strcmp(FileType.c_str(), "Diff"))
eTexture = aiTextureType::aiTextureType_DIFFUSE;
else if (!strcmp(FileType.c_str(), "d"))
eTexture = aiTextureType::aiTextureType_DIFFUSE;
else if (!strcmp(FileType.c_str(), "N"))
eTexture = aiTextureType::aiTextureType_NORMALS;
else if (!strcmp(FileType.c_str(), "normal"))
eTexture = aiTextureType::aiTextureType_NORMALS;
else if (!strcmp(FileType.c_str(), "Norm"))
eTexture = aiTextureType::aiTextureType_NORMALS;
else if (!strcmp(FileType.c_str(), "n"))
eTexture = aiTextureType::aiTextureType_NORMALS;
else if (!strcmp(FileType.c_str(), "MRO"))
eTexture = aiTextureType::aiTextureType_METALNESS;
else if (!strcmp(FileType.c_str(), "3Broom"))
eTexture = aiTextureType::aiTextureType_METALNESS;
else if (!strcmp(FileType.c_str(), "MROH"))
eTexture = aiTextureType::aiTextureType_METALNESS;
else if (!strcmp(FileType.c_str(), "MRAB"))
eTexture = aiTextureType::aiTextureType_METALNESS;
else if (!strcmp(FileType.c_str(), "MROA"))
eTexture = aiTextureType::aiTextureType_SPECULAR;
else if (!strcmp(FileType.c_str(), "SRO"))
eTexture = aiTextureType::aiTextureType_SPECULAR;
else if (!strcmp(FileType.c_str(), "HRO"))
eTexture = aiTextureType::aiTextureType_SPECULAR;
else if (!strcmp(FileType.c_str(), "SROH"))
eTexture = aiTextureType::aiTextureType_SPECULAR;
else if (!strcmp(FileType.c_str(), "SROA"))
+21 -5
View File
@@ -151,11 +151,25 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform)
return false; // 잘못된 초기화
}
if (true == m_pLerpAnim->IsLerping()) { // 럴프중이면 자동으로 럴프 Update를 부름
m_bIsFinishedLerp = m_pLerpAnim->Update_TransformationMatrices(m_Bones, fTimeDelta);
}
else { // 럴프중이지 않다면 실제 애니메이션 재생을 시작함
if (m_iPreAnimIndex != m_iCurrentAnimIndex && m_iPreAnimIndex != 0)
{
m_fBlendTime += fTimeDelta;
_float fRatio = m_fBlendTime / m_fBlendDuration;
fRatio = min(fRatio, 1.f);
m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, pTransform);
m_Animations[m_iCurrentAnimIndex]->InterpAnim(m_Animations[m_iPreAnimIndex], m_Bones, fRatio);
if (fRatio >= 1.f)
{
m_iPreAnimIndex = m_iCurrentAnimIndex;
m_fBlendTime = 0.f;
}
}
else
{
m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, pTransform);
m_iPreAnimIndex = m_iCurrentAnimIndex;
}
for (_int i = 0; i < m_Bones.size(); ++i)
@@ -199,6 +213,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop)
m_iCurrentAnimIndex = iIndex;
m_bIsLoop = isLoop;
m_Animations[m_iCurrentAnimIndex]->ResetRootMotion();
m_Animations[m_iCurrentAnimIndex]->Depart_Animation();
}
else
m_iCurrentAnimIndex = -1;
@@ -899,13 +914,14 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
return E_FAIL;
}
#ifdef 기무리
if (MODEL::ENVIROMENT == m_eType) {
m_pGameInstance->LoadTriMeshes(pModelFilePath, m_TriMeshes);
for (_uint i = 0; i < m_iNumMeshes; ++i) {
m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]);
}
}
#endif //
return S_OK;
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Prototype_Manager.h"
#include "GameObject.h"
@@ -115,6 +115,13 @@ HRESULT CPrototype_Manager::Ready_EngineAssets()
VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) {
return E_FAIL;
}
if (FAILED(Add_Asset_Prototype(g_iStaticLevel, TEXT("FX_WEIGHTBELND"),
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl"),
VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) {
return E_FAIL;
}
return S_OK;
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "RenderTarget_Manager.h"
#include "RenderTarget.h"
@@ -114,6 +114,33 @@ HRESULT CRenderTarget_Manager::Begin_MRT_Include_BackBuffer(const _wstring& strM
return S_OK;
}
HRESULT CRenderTarget_Manager::Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag)
{
m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV);
list<CRenderTarget*>* pMRTList = Find_MRT(strMRTTag);
if (nullptr == pMRTList)
return E_FAIL;
_uint iNumRenderTargets = { 0 };
ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};
m_pContext->OMSetRenderTargets(0, nullptr, nullptr);
for (auto& pRenderTarget : *pMRTList)
{
pRenderTarget->Clear();
pRenderTargetViews[iNumRenderTargets++] = pRenderTarget->Get_RTV();
}
if (0 == iNumRenderTargets) {
return E_FAIL;
}
m_pContext->OMSetRenderTargets(iNumRenderTargets, pRenderTargetViews, nullptr);
return S_OK;
}
HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D)
{
CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag);
+69 -8
View File
@@ -26,6 +26,7 @@ HRESULT CRenderer::Add_RenderGroup(RENDER eRenderGroup, CGameObject* pRenderObje
if (RENDER::UI == eRenderGroup || RENDER::PRIORITY == eRenderGroup /* || RENDER::SHADOW == eRenderGroup*/ || RENDER::BLUR == eRenderGroup) {
bPossible = true;
}
bPossible = true;
if (true == bPossible) {
m_RenderObjects[ENUM_CLASS(eRenderGroup)].push_back(pRenderObject);
@@ -64,6 +65,7 @@ void CRenderer::Render()
Render_Blur();
Render_Combined();
Render_Effect();
Render_WeightBlend();
Render_NonLight();
Render_Blend();
Render_LastColor();
@@ -71,7 +73,7 @@ void CRenderer::Render()
#ifdef _DEBUG
m_pGameInstance->RenderTarget_Debuger();
if(m_pGameInstance->Key_Pressing(DIK_F10))
Render_Debug();
#endif
@@ -270,10 +272,11 @@ void CRenderer::Render_Combined()
void CRenderer::Render_Effect()
{
if (FAILED(m_pGameInstance->Begin_MRT_Include_BackBuffer(TEXT("MRT_Color")))) {
if (FAILED(m_pGameInstance->Begin_MRT_NO_DepthStencil(TEXT("MRT_WB")))) {
return;
}
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)])
{
if (nullptr != pRenderObject)
@@ -290,6 +293,30 @@ void CRenderer::Render_Effect()
}
}
void CRenderer::Render_WeightBlend()
{
// Bind_Resorces
m_pWeightBlendShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix);
m_pWeightBlendShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix);
m_pWeightBlendShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix);
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_WB_Color"), m_pWeightBlendShader, "g_MixedDiffuseTexture"))) {
return;
}
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_WB_Revealage"), m_pWeightBlendShader, "g_RevealageTexture"))) {
return;
}
m_pWeightBlendShader->Begin(0);
m_pVIBuffer->Bind_Resources();
m_pVIBuffer->Render();
}
void CRenderer::Render_NonLight()
{
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::NONLIGHT)])
@@ -417,9 +444,9 @@ void CRenderer::Render_LastColor()
}
HRESULT CRenderer::Ready_DepthStencilView(_uint iSizeX, _uint iSizeY)
HRESULT CRenderer::Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY)
{
ID3D11Texture2D* pDepthStencilTexture = nullptr;
ID3D11Texture2D* pShadowDepthStencilTexture = nullptr;
D3D11_TEXTURE2D_DESC TextureDesc;
ZeroMemory(&TextureDesc, sizeof(D3D11_TEXTURE2D_DESC));
@@ -438,16 +465,16 @@ HRESULT CRenderer::Ready_DepthStencilView(_uint iSizeX, _uint iSizeY)
TextureDesc.CPUAccessFlags = 0;
TextureDesc.MiscFlags = 0;
if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &pDepthStencilTexture))) {
if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &pShadowDepthStencilTexture))) {
return E_FAIL;
}
if (FAILED(m_pDevice->CreateDepthStencilView(pDepthStencilTexture, nullptr, &m_pShadowDSV))) {
if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, &m_pShadowDSV))) {
return E_FAIL;
}
SAFE_RELEASE(pDepthStencilTexture);
SAFE_RELEASE(pShadowDepthStencilTexture);
return S_OK;
}
@@ -559,8 +586,22 @@ HRESULT CRenderer::Initialize()
}
/*WB_COLOR*/
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_WB_Color"), (_uint)Viewport.Width, (_uint)Viewport.Height,
DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) {
return E_FAIL;
}
if (FAILED(Ready_DepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) {
/* WB_A*/
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_WB_Revealage"), (_uint)Viewport.Width, (_uint)Viewport.Height,
DXGI_FORMAT_R16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) {
return E_FAIL;
}
if (FAILED(Ready_ShadowDepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) {
return E_FAIL;
}
@@ -614,8 +655,23 @@ HRESULT CRenderer::Initialize()
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Color"), TEXT("Target_Color")))) {
return E_FAIL;
}
/* MRT_WB */
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_WB_Color")))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_WB_Revealage")))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_WB"), TEXT("Target_Color")))) {
return E_FAIL;
}
}
m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("FX_DEFERRED"), nullptr, nullptr);
if (nullptr == m_pShader) {
return E_FAIL;
@@ -628,7 +684,11 @@ HRESULT CRenderer::Initialize()
return E_FAIL;
}
m_pWeightBlendShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("FX_WEIGHTBELND"), nullptr, nullptr);
if (nullptr == m_pWeightBlendShader) {
return E_FAIL;
}
m_pVIBuffer = CVIBuffer_Rect::Create(m_pDevice, m_pContext);
if (nullptr == m_pVIBuffer) {
@@ -678,6 +738,7 @@ void CRenderer::Free()
SAFE_RELEASE(m_pShadowDSV);
SAFE_RELEASE(m_pShader);
SAFE_RELEASE(m_pLastColorShader);
SAFE_RELEASE(m_pWeightBlendShader);
SAFE_RELEASE(m_pVIBuffer);
SAFE_RELEASE(m_pDevice);
SAFE_RELEASE(m_pContext);
@@ -29,6 +29,8 @@ HRESULT CRigidBody::Initialize(void* pArg)
m_pTransform = m_pOwner->Get_Component<CTransform>();
SAFE_ADDREF(m_pTransform);
m_tagData.iSubKind = pDesc->iSubKind;
return S_OK;
}
@@ -60,7 +60,7 @@ void CRigidBody_Dynamic::Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum
{
PSX::PxVec3 vPxTorque = {};
XMStoreFloat3((_float3*)&vPxTorque, vDirection);
m_pRigidBody->addForce(vPxTorque, eType);
m_pRigidBody->addTorque(vPxTorque, eType);
}
void CRigidBody_Dynamic::Set_Kinematic(_bool bKinematic)
@@ -118,14 +118,15 @@ HRESULT CRigidBody_Dynamic::Add_DebugShape()
switch (m_eActorType)
{
case ACTOR::BOX:
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, m_vhalfGeometryInfo, false, false));
_float3 vDXGeometricSize = { m_vhalfGeometryInfo.x * 2.f, m_vhalfGeometryInfo.y * 2.f, m_vhalfGeometryInfo.z * 2.f };
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vDXGeometricSize, 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));
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x * 2.f, 10, false, false));
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, m_vhalfGeometryInfo.y * 2.f, m_vhalfGeometryInfo.x * 2.f, 10, false));
break;
case ACTOR::SPHERE:
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x, 10, false, false));
m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, m_vhalfGeometryInfo.x * 2.f, 10, false, false));
break;
default:
break;
+49
View File
@@ -0,0 +1,49 @@
#include "pch.h"
#include "State.h"
#include "GameInstance.h"
#include "Unit.h"
CState::CState()
: m_pGameInstance{ CGameInstance::GetInstance() }
{
SAFE_ADDREF(m_pGameInstance);
}
void CState::Enter()
{
}
void CState::Update(_float fTimeDelta)
{
}
void CState::Exit()
{
}
_bool CState::CheckExitState()
{
return true;
}
void CState::Set_Owner(CGameObject* pOwner)
{
m_pOwner = dynamic_cast<CUnit*>(pOwner);
};
void CState::Set_Component()
{
m_pModel = m_pOwner->Get_Component<CModel>();
m_pFSM = m_pOwner->Get_Component<CFSM>();
}
void CState::Free()
{
__super::Free();
SAFE_RELEASE(m_pGameInstance);
}
void CState::Describe_Entity()
{
}
+76
View File
@@ -0,0 +1,76 @@
#include "pch.h"
#include "Unit.h"
#include "GameInstance.h"
CUnit::CUnit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject(pDevice, pContext)
{
}
CUnit::CUnit(const CUnit& Prototype)
: CGameObject(Prototype)
{
}
HRESULT CUnit::Initialize_Prototype()
{
return S_OK;
}
HRESULT CUnit::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
m_Animation.resize(FSMSTATE::END);
return S_OK;
}
void CUnit::Priority_Update(_float fTimeDelta)
{
}
void CUnit::Update(_float fTimeDelta)
{
}
void CUnit::Late_Update(_float fTimeDelta)
{
}
HRESULT CUnit::Render()
{
return S_OK;
}
HRESULT CUnit::Ready_Components(void *pArg)
{
__super::Ready_Components(pArg);
/* Com_FSM */
if (FAILED(Add_Component<CFSM>(g_iStaticLevel, &m_pFSM)))
return E_FAIL;
return S_OK;
}
HRESULT CUnit::Bind_ShaderResources()
{
return S_OK;
}
void CUnit::Free()
{
__super::Free();
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
SAFE_RELEASE(m_pFSM);
}
void CUnit::Describe_Entity()
{
}
+2 -2
View File
@@ -20,6 +20,7 @@ class ENGINE_DLL CAnimation : public CBase
_int Get_AnimProgressPostion(const _char* pAnimChannelName);
void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition);
vector<_int>* Capture_Bones();
void InterpAnim(CAnimation* pPreAnim, vector<CBone*>& Bones, float fRatio);
vector<LERPDESC> Get_StartFrameInformations() { return m_StartKeyFrames; }
const _string& Get_Name() const { return m_strName; }
@@ -28,7 +29,6 @@ class ENGINE_DLL CAnimation : public CBase
_float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; }
void Set_AnimSpeed(_float fSpeed) { m_fAnimSpeed = fSpeed; }
_float Get_AnimSpeed() { return m_fAnimSpeed; }
void Remap_Channels_By_Name(class CModel* TargetModel);
#ifdef EDITOR_PROJECT
private:
HRESULT Initialize(const vector<class CBone*>& Bones, const aiAnimation* pAIAnimation);
@@ -63,7 +63,7 @@ class ENGINE_DLL CAnimation : public CBase
vector<_int> m_DestBones; // 이 애니메이션에서 영향을 받는 본들의 집합
vector<LERPDESC> m_StartKeyFrames; // 이 애니메이션의 영향을 받는 본들의 초기값
vector<_matrix> m_vBoneTransformationMatrix = {};
public:
static CAnimation* Create(HANDLE hFile, DWORD& dwByte);
// 바이너리
+2
View File
@@ -23,6 +23,7 @@ class ENGINE_DLL CChannel : public CBase
_int Get_BoneIndex() { return { m_iBoneIndex }; }
void Set_BoneIndex(_int iBoneIndex) { m_iBoneIndex = iBoneIndex; }
void ResetRootMotion() { m_vPrevRootPos = { 0.f, 0.f, 0.f }; }
_matrix Get_BoneTransformationMatrix() { return m_BoneTransformationMatrix; }
KEYFRAME* Get_Frame(_uint iIndex);
void Set_Frame(_uint iIndex, KEYFRAME& kf);
@@ -45,6 +46,7 @@ class ENGINE_DLL CChannel : public CBase
_float4x4 m_PreTransformMatrix = {};
vector<KEYFRAME> m_KeyFrames; // 키프레임 벡터
_float3 m_vPrevRootPos = { 0.f, 0.f, 0.f };
_matrix m_BoneTransformationMatrix = {};
public:
static CChannel* Create(const vector<class CBone*>& Bones, _uint iIndex); // 럴프전용
static CChannel* Create(HANDLE hFile, DWORD& dwByte);
@@ -12,9 +12,6 @@ class ENGINE_DLL CCharacter_Controller final :
// kinematic 기반임
public:
#pragma region STRUCT
struct CapsuleInfo
{
};
typedef struct tagCharacter_ControllerDesc
{
CTransform* pTransform = { nullptr };
@@ -23,7 +20,7 @@ class ENGINE_DLL CCharacter_Controller final :
_float3 fMaterial = { 0.5f, 0.5f, 0.6f };
_bool bAutoStepping = { false }; // 계단 높이 타게 할건지 // 박스 콜라이더는 생각한대로 되는데 캡슐은 바닥의 구체 때문에 예상보다 더 높은 곳까지 오를 수 있음
_float fStepOffset = { 0.05f }; // 허용가능한 계단 높이, 작게 유지하는게 좋음
_uint iSubKind = { };
PSX::PxUserControllerHitReport* pCallback_HitReport = { }; // move가 호출될 때 호출 됨 // dll을 받는 각 프로젝트에서 구현해야함
PSX::PxControllerBehaviorCallback* pCallback_Behavior = { }; // move가 호출될 때 호출 됨 // dll을 받는 각 프로젝트에서 구현해야함
+4 -1
View File
@@ -20,7 +20,10 @@ enum class PXMATERIAL {
DEFAULT,
END,
};
enum class PXBODYSTATE {
DYNAMIC,
KINEMATIC,
};
enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON };
enum class MOUSEMOVESTATE { X, Y, W };
+50
View File
@@ -0,0 +1,50 @@
#include "Component.h"
NS_BEGIN(FSMSTATE)
enum ESTATE
{
IDLE,
WALK,WALK_FWD, WALK_BWD,
JOG,
SPRINT,
JUMP,
DODGE,
ATTACK,
END
};
NS_END
NS_BEGIN(Engine)
class CState;
class ENGINE_DLL CFSM final : public CComponent
{
private:
CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CFSM(const CFSM& rhs);
virtual ~CFSM() = default;
public:
void Add_State(_uint iIndex, CState* state);
void Change_State(_uint iIndex);
void Update(_float fTimeDelta);
private:
vector<CState*> m_States;
CState* m_pCurrent = { nullptr };
private:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
public:
static CFSM* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
virtual void Free() override;
virtual void Describe_Entity() override;
};
NS_END
@@ -27,6 +27,7 @@ class ENGINE_DLL CGameInstance final : public CBase
public:
void Render_Begin(const _float4* pClearColor);
void Render_End();
HRESULT Bind_DepthStencil(class CShader* pShader, const _char* pContantName);
#pragma endregion
#pragma region TIMER_MANAGER
@@ -152,6 +153,7 @@ class ENGINE_DLL CGameInstance final : public CBase
HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey);
HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr);
HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr);
HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag);
HRESULT End_MRT();
HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName);
HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D);
@@ -20,6 +20,8 @@ class CGraphic_Device final
HRESULT Present();
HRESULT Bind_DepthStencil(class CShader* pShader, const _char* pContantName);
private:
ID3D11Device* m_pDevice = { nullptr };
ID3D11DeviceContext* m_pDeviceContext = { nullptr };
@@ -27,7 +29,7 @@ class CGraphic_Device final
IDXGISwapChain* m_pSwapChain = { nullptr };
ID3D11RenderTargetView* m_pBackBufferRTV = { nullptr };
ID3D11DepthStencilView* m_pDepthStencilView = { nullptr };
ID3D11ShaderResourceView* m_pDepthStencilSRV = { nullptr };
private:
HRESULT Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY);
HRESULT Ready_BackBufferRenderTargetView();
@@ -38,4 +40,4 @@ class CGraphic_Device final
virtual void Free() override;
};
NS_END
NS_END
@@ -26,6 +26,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
_float2 vMaskingUVMoveTime = { 1.f, 1.f };
_float2 vDiffuseUVMoveTime = { 1.f, 1.f };
_float2 vDistortionUVMoveTime = { 1.f , 1.f };
_float2 vNoiseUVMoveTime = { 1.f ,1.f };
_float2 vAniTime = { 1.f , 1.f };
_float2 vAniIndex = {};
@@ -60,6 +61,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
_float2 vMaskingUVMoveTime = {};
_float2 vDiffuseUVMoveTime = {};
_float2 vDistortionUVMoveTime = {};
_float2 vNoiseUVMoveTime = {};
_float2 vAniTime = {};
+5 -1
View File
@@ -108,6 +108,11 @@ static _int Get_BoneIndex(const _char* pBoneName, vector<class CBone*> Bones); /
_bool m_bIsFinishedAnim = { false }; // 대상 애니메이션이 끝났는지
_bool m_bIsFinishedLerp = { false }; // 럴프 애니메이션이 끝났는지
_bool m_bPlayAnim = { true };
_int m_iPreAnimIndex = { 0 };
_float m_fBlendTime = { 0.f };
_float m_fBlendDuration = { 0.3f };
vector<class CAnimation*> m_Animations; // 애니메이션의 벡터,
class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메이션
@@ -122,7 +127,6 @@ static _int Get_BoneIndex(const _char* pBoneName, vector<class CBone*> Bones); /
SaveModel* m_pSaveModel = { nullptr };
list<SaveModel> m_SaveModel;
//
private:
// 바이너리
virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix);
@@ -13,6 +13,8 @@
#include "Instance_Model.h"
#include "Character_Controller.h"
#include "Light.h"
#include "FSM.h"
#include "State.h"
#include "VIBuffer_UI_Instance.h"
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Base.h"
NS_BEGIN(Engine)
@@ -14,6 +14,7 @@ class CRenderTarget_Manager final : public CBase
HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey);
HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV);
HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV);
HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag);
HRESULT End_MRT();
HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName);
HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D);
@@ -48,4 +49,4 @@ class CRenderTarget_Manager final : public CBase
virtual void Free()override;
};
NS_END
NS_END
+3 -3
View File
@@ -31,6 +31,7 @@ class CRenderer final : public CBase
private:
class CShader* m_pShader = { nullptr };
class CShader* m_pLastColorShader = { nullptr };
class CShader* m_pWeightBlendShader = { nullptr };
class CVIBuffer_Rect* m_pVIBuffer = { nullptr };
private:
@@ -52,6 +53,7 @@ class CRenderer final : public CBase
void Render_Blur();
void Render_Combined();
void Render_Effect();
void Render_WeightBlend();
void Render_NonLight();
void Render_Blend();
void Render_LastColor();
@@ -64,9 +66,7 @@ class CRenderer final : public CBase
#endif
private:
HRESULT Ready_DepthStencilView(_uint iSizeX, _uint iSizeY);
HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY);
private:
HRESULT Initialize();
+1 -1
View File
@@ -26,7 +26,7 @@ class ENGINE_DLL CRigidBody abstract : public CComponent
typedef struct tagRigidBody_Desc
{
_uint iSubKind = { };
}RIGIDBODY_DESC;
protected:
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include "Base.h"
NS_BEGIN(Engine)
class CUnit;
class CModel;
class CFSM;
class CGameInstance;
class ENGINE_DLL CState abstract : public CBase
{
protected:
CState();
virtual ~CState() = default;
public:
virtual void Enter();
virtual void Update(_float fTimeDelta);
virtual void Exit();
virtual _bool CheckExitState();
void Set_Owner(class CGameObject* pOwner);
virtual void Set_Component();
protected:
CUnit* m_pOwner = { nullptr };
CModel* m_pModel = { nullptr };
CFSM* m_pFSM = { nullptr };
CGameInstance* m_pGameInstance = { nullptr };
public:
virtual void Free() override;
virtual void Describe_Entity();
};
NS_END
+1 -1
View File
@@ -67,7 +67,7 @@ class ENGINE_DLL CTransform final :
_float m_fSpeedPerSec = {};
_float m_fRotationPerSec = {};
_float4x4 m_WorldMatrix = {};
_float m_fRadius = {20.f};
_float m_fRadius = { 20.f };
_float3 m_vMomentum = {}; // 현재 프레임에 계산된 이동량
_float3 m_vBackMomentum = {}; // 다음 프레임에 계산될 이동량
+66
View File
@@ -0,0 +1,66 @@
#pragma once
#include "Engine_Define.h"
#include "GameObject.h"
NS_BEGIN(Engine)
class CShader;
class CModel;
class CFSM;
class ENGINE_DLL CUnit abstract : public CGameObject
{
public:
typedef struct tagObjectDesc
{
const _tchar* pModelPrototypeTag;
}PARTS_OBJECT_DESC;
protected:
CUnit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CUnit(const CUnit& Prototype);
virtual ~CUnit() = 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;
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
public:
pair<_uint, _bool> Get_AnimInfo(_uint iIndex) { return m_Animation[iIndex]; }
virtual _bool IsWalking() { return false; }
virtual _bool IsDodge() { return false; }
virtual _bool IsSprint() { return false; }
virtual _bool IsJump() { return false; }
protected:
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
CFSM* m_pFSM = { nullptr };
_wstring m_strModelPrototypeTag;
_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 };
vector<pair<_uint,_bool>> m_Animation;
private:
virtual void Add_FSM() {};
virtual void Set_Anim() {};
protected:
HRESULT Ready_Components(void*pArg);
HRESULT Bind_ShaderResources();
public:
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
virtual void Free() override;
virtual void Describe_Entity() override;
};
NS_END