Merge branch 'Develope' into Model
This commit is contained in:
@@ -19,8 +19,11 @@ float g_fSpotOuterAngle;
|
||||
|
||||
vector g_vLightDir;
|
||||
vector g_vLightPos;
|
||||
vector g_vLightPosOffset;
|
||||
|
||||
vector g_vCamPosition;
|
||||
|
||||
|
||||
Texture2D g_NormalTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_ShadeTexture;
|
||||
@@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
|
||||
vector vLightDir = vPosition - g_vLightPos;
|
||||
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
|
||||
float fDistance = length(vLightDir);
|
||||
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_GamePlay.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
@@ -46,7 +46,7 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_GamePlay::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다"));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -58,11 +58,12 @@ HRESULT CLevel_GamePlay::Ready_Lights()
|
||||
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);
|
||||
//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;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
assert(false);
|
||||
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
namespace Client {
|
||||
|
||||
#ifndef __TEXT
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 135 B |
@@ -19,8 +19,11 @@ float g_fSpotOuterAngle;
|
||||
|
||||
vector g_vLightDir;
|
||||
vector g_vLightPos;
|
||||
vector g_vLightPosOffset;
|
||||
|
||||
vector g_vCamPosition;
|
||||
|
||||
|
||||
Texture2D g_NormalTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_ShadeTexture;
|
||||
@@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
|
||||
vector vLightDir = vPosition - g_vLightPos;
|
||||
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
|
||||
float fDistance = length(vLightDir);
|
||||
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f)
|
||||
|
||||
@@ -29,6 +29,7 @@ Texture2D g_NormalTexture : register(t1);
|
||||
Texture2D g_MaskingTexture : register(t2);
|
||||
Texture2D g_DissolveTexture : register(t3);
|
||||
Texture2D g_NoiseTexture : register(t4);
|
||||
Texture2D g_EmissiveTexture : register(t6);
|
||||
|
||||
StructuredBuffer<ParticleValue> g_ParticleValue : register(t5);
|
||||
|
||||
@@ -65,6 +66,7 @@ bool g_isDiffuse;
|
||||
bool g_isMasking;
|
||||
bool g_isDissolve;
|
||||
bool g_isNoise;
|
||||
bool g_isEmissive;
|
||||
|
||||
bool g_isDiffuseUVMove;
|
||||
bool g_isMaskUVMove;
|
||||
@@ -323,8 +325,16 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
|
||||
// 색깔 추가할 처리 (이미시브)
|
||||
|
||||
float4 vEmissiveMtrl;
|
||||
|
||||
if (g_isEmissive == true)
|
||||
{
|
||||
vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
}
|
||||
|
||||
if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha)
|
||||
Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f);
|
||||
else
|
||||
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
|
||||
Binary file not shown.
@@ -167,6 +167,7 @@
|
||||
<ClInclude Include="..\public\Active_Icon.h" />
|
||||
<ClInclude Include="..\Public\DummyObject.h" />
|
||||
<ClInclude Include="..\public\DummySkyBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Plane.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
|
||||
<ClInclude Include="..\public\GamePlay_Canvas.h" />
|
||||
<ClInclude Include="..\public\BuildingContainer.h" />
|
||||
@@ -233,6 +234,7 @@
|
||||
<ClCompile Include="..\private\Active_Icon.cpp" />
|
||||
<ClCompile Include="..\Private\DummyObject.cpp" />
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Plane.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXPlayable.cpp" />
|
||||
<ClCompile Include="..\private\GamePlay_Canvas.cpp" />
|
||||
<ClCompile Include="..\private\BuildingContainer.cpp" />
|
||||
|
||||
@@ -199,6 +199,9 @@
|
||||
<Filter Include="02.GameObjects\MainLight">
|
||||
<UniqueIdentifier>{a9360a97-5ef2-476a-9f12-f4e06c28290c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Dummy_Plane">
|
||||
<UniqueIdentifier>{6872c5bc-5eac-46a1-b6d8-3ec0f4fb2cd5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -402,6 +405,9 @@
|
||||
<ClInclude Include="..\Public\MainLight.h">
|
||||
<Filter>02.GameObjects\MainLight</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Plane.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -601,6 +607,9 @@
|
||||
<ClCompile Include="..\Private\MainLight.cpp">
|
||||
<Filter>02.GameObjects\MainLight</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Plane.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Active_Icon.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Body.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -75,7 +75,7 @@ CBody* CBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CBody");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -88,7 +88,7 @@ CGameObject* CBody::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CBody");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "PartObject.h"
|
||||
#include "Terrain.h"
|
||||
|
||||
@@ -129,7 +129,7 @@ CDummyObject* CDummyObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* p
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummyObject");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -142,7 +142,7 @@ CGameObject* CDummyObject::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummyObject");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -154,8 +154,8 @@ void CDummyObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummyObject::Describe_Entity()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "DummyRect.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "DummySkyBox.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Dummy_Cube.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXBox.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -155,8 +155,8 @@ void CDummy_PhysXBox::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXBox::Describe_Entity()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXMesh.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -117,9 +117,9 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.tCapsuleInfo.fRadius = 0.5f;
|
||||
Desc.tCapsuleInfo.fHeight = 1.0f;
|
||||
Desc.tCapsuleInfo.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -188,8 +188,8 @@ void CDummy_PhysXPlayable::Free()
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CDummy_PhysXPlayable::Describe_Entity()
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_Plane.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummy_Plane::CDummy_Plane(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_Plane::CDummy_Plane(const CDummy_Plane& rhs)
|
||||
: CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_Plane::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Plane::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(0.f, -10.f, 0.f, 1.f));
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_Plane::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_Plane::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CDummy_Plane::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
}
|
||||
|
||||
HRESULT CDummy_Plane::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Plane::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
///* Com_Model */
|
||||
//if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"),
|
||||
// reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
// return E_FAIL;
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Model_DummyPlane"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Plane::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_Plane* CDummy_Plane::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_Plane* pInstance = new CDummy_Plane(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_Plane");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_Plane::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_Plane* pInstance = new CDummy_Plane(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_Plane");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_Plane::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
}
|
||||
|
||||
void CDummy_Plane::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "EditEffect.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -41,7 +41,7 @@ void CEditEffect::Update(_float fTimeDelta)
|
||||
|
||||
|
||||
|
||||
if (m_isBillboard)
|
||||
if (m_EffectInfo.isBillboard)
|
||||
m_pGameInstance->BillBoard(m_pTransformCom);
|
||||
|
||||
if (m_pInstance_ModelCom == nullptr)
|
||||
@@ -61,15 +61,16 @@ void CEditEffect::Late_Update(_float fTimeDelta)
|
||||
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
|
||||
if (m_isBlur == true)
|
||||
if (m_EffectInfo.isBlur == true)
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(m_eRenderOrder, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
m_pGameInstance->Add_RenderGroup(m_EffectInfo.eRenderOrder, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
}
|
||||
|
||||
void CEditEffect::Reference_Mat_For_EditEffect()
|
||||
{
|
||||
|
||||
string strName = {};
|
||||
|
||||
const char* pCompute[] = { "DIFFUSE" , "MASK", "NOISE", "DISSOLVE" };
|
||||
|
||||
@@ -79,16 +80,37 @@ void CEditEffect::Reference_Mat_For_EditEffect()
|
||||
switch (m_iSelectTextureNum)
|
||||
{
|
||||
case 0:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this);
|
||||
strName = dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this);
|
||||
|
||||
if (strName != "")
|
||||
{
|
||||
m_strDiffuseName = strName;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this);
|
||||
strName =dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this);
|
||||
|
||||
if (strName != "")
|
||||
{
|
||||
m_strMaskingName = strName;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this);
|
||||
strName = dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this);
|
||||
|
||||
if (strName != "")
|
||||
{
|
||||
m_strNoiseName = strName;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this);
|
||||
strName = dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this);
|
||||
|
||||
if (strName != "")
|
||||
{
|
||||
m_strDissolveName = strName;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -97,6 +119,145 @@ void CEditEffect::Reference_Mat_For_EditEffect()
|
||||
|
||||
}
|
||||
|
||||
HRESULT CEditEffect::Save_Effect(const _char* pPath)
|
||||
{
|
||||
|
||||
_string strPerfectFilePath = pPath;
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(),
|
||||
GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL
|
||||
);
|
||||
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(NULL, L"오브젝트 저장 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
if (m_pLightCom != nullptr)
|
||||
{
|
||||
m_EffectInfo.LightDesc = *m_pLightCom->Get_LightDesc();
|
||||
}
|
||||
|
||||
|
||||
if (!WriteFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isDiffuse)
|
||||
{
|
||||
size_t iComponentLength = m_strDiffuseName.length();
|
||||
const _char* pFileComponentPath = m_strDiffuseName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isNoise)
|
||||
{
|
||||
size_t iComponentLength = m_strNoiseName.length();
|
||||
const _char* pFileComponentPath = m_strNoiseName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isMasking)
|
||||
{
|
||||
size_t iComponentLength = m_strMaskingName.length();
|
||||
const _char* pFileComponentPath = m_strMaskingName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isDissolve)
|
||||
{
|
||||
size_t iComponentLength = m_strDissolveName.length();
|
||||
const _char* pFileComponentPath = m_strDissolveName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isEmissive)
|
||||
{
|
||||
size_t iComponentLength = m_strEmissiveName.length();
|
||||
const _char* pFileComponentPath = m_strEmissiveName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t iComponentLength = m_strModelName.length();
|
||||
const _char* pFileComponentPath = m_strModelName.c_str();
|
||||
|
||||
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
m_pInstance_ModelCom->Save_InstanceModel(hFile);
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEditEffect::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg)))
|
||||
@@ -146,32 +307,32 @@ void CEditEffect::Free()
|
||||
|
||||
void CEditEffect::Describe_Entity()
|
||||
{
|
||||
//여기서 모델, 텍스쳐, 선택할 수 있도록 함
|
||||
//여기서 모델, 텍스쳐, 선택할 수 있도록 함
|
||||
|
||||
const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" };
|
||||
const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" };
|
||||
|
||||
_int iCurrentItem = static_cast<_int>(m_eRenderOrder);
|
||||
_int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder);
|
||||
|
||||
if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
|
||||
{
|
||||
m_eRenderOrder = static_cast<RENDER>(iCurrentItem);
|
||||
m_EffectInfo.eRenderOrder = static_cast<RENDER>(iCurrentItem);
|
||||
}
|
||||
|
||||
m_pTransformCom->Describe_Entity();
|
||||
|
||||
GUI::Checkbox("Diffuse", &m_isDiffuse);
|
||||
GUI::Checkbox("Masking", &m_isMasking);
|
||||
GUI::Checkbox("Dissolve", &m_isDissolve);
|
||||
GUI::Checkbox("Noise", &m_isNoise);
|
||||
GUI::Checkbox("Diffuse", &m_EffectInfo.isDiffuse);
|
||||
GUI::Checkbox("Masking", &m_EffectInfo.isMasking);
|
||||
GUI::Checkbox("Dissolve", &m_EffectInfo.isDissolve);
|
||||
GUI::Checkbox("Noise", &m_EffectInfo.isNoise);
|
||||
|
||||
|
||||
if (GUI::Checkbox("Billboard", &m_isBillboard))
|
||||
if (GUI::Checkbox("Billboard", &m_EffectInfo.isBillboard))
|
||||
{
|
||||
m_pTransformCom->Rotation(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_vColor);
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_EffectInfo.vColor);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
|
||||
@@ -181,11 +342,11 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
if (GUI::TreeNode("BLUR"))
|
||||
{
|
||||
GUI::Checkbox("Blur", &m_isBlur);
|
||||
GUI::Checkbox("Blur", &m_EffectInfo.isBlur);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("BlurIntensity", &m_fBlurIntensity, 0.005f, 0.f, 1.f);
|
||||
GUI::DragInt("BlurWeight", &m_iBlurWeight, 1.f, 0, 32);
|
||||
GUI::DragFloat("BlurIntensity", &m_EffectInfo.fBlurIntensity, 0.005f, 0.f, 1.f);
|
||||
GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 1.f, 0, 32);
|
||||
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
@@ -198,24 +359,73 @@ void CEditEffect::Describe_Entity()
|
||||
{
|
||||
const char* pCompute[] = {"NONE", "DIV" , "PLUS", "SUBSTRACT", "MULTY" , "EQUL" };
|
||||
|
||||
_int iColorOption = (_int)m_fColorOption;
|
||||
_int iColorOption = (_int)m_EffectInfo.fColorOption;
|
||||
|
||||
if (ImGui::Combo("OPTION", &iColorOption, pCompute , 6))
|
||||
{
|
||||
m_fColorOption = (_float)iColorOption;
|
||||
m_EffectInfo.fColorOption = (_float)iColorOption;
|
||||
}
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat("EmissiveCutAlpha", &m_fEmissiveCutAlpha, 0.005f, 0.f, 1.f);
|
||||
GUI::DragFloat("EmissiveCutAlpha", &m_EffectInfo.fEmissiveCutAlpha, 0.005f, 0.f, 1.f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
GUI::ColorEdit4("Emissive", (_float*)&m_vEmissive);
|
||||
GUI::ColorEdit4("Emissive", (_float*)&m_EffectInfo.vEmissive);
|
||||
|
||||
GUI::Checkbox("EmissiveTex", &m_EffectInfo.isEmissive);
|
||||
|
||||
if (m_EffectInfo.isEmissive)
|
||||
{
|
||||
if (GUI::TreeNode("EMISSIVE_TEX"))
|
||||
{
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "EMISSIVE_TEXTURE", (CComponent**)&m_pEmissive_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strEmissiveName = strName;
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
if (GUI::TreeNode("LIGHT"))
|
||||
{
|
||||
if (GUI::Button("ADD LIGHT"))
|
||||
{
|
||||
if (m_pLightCom != nullptr)
|
||||
{
|
||||
GUI::TreePop();
|
||||
return;
|
||||
}
|
||||
LIGHT_DESC LightDesc{};
|
||||
|
||||
LightDesc.eType = LIGHT::POINT;
|
||||
LightDesc.vDiffuse = _float4(0.0f, 0.0f, 0.0f, 0.f);
|
||||
LightDesc.vAmbient = _float4(0.0f, 0.0f, 0.0f, 0.f);
|
||||
LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
|
||||
LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION);
|
||||
LightDesc.iLevel = NEXT_LEVEL;
|
||||
|
||||
/* Com_Light*/
|
||||
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &LightDesc)))
|
||||
{
|
||||
GUI::TreePop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pLightCom != nullptr)
|
||||
{
|
||||
m_pLightCom->Describe_Entity();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
if (GUI::TreeNode("MODEL"))
|
||||
{
|
||||
@@ -224,7 +434,11 @@ void CEditEffect::Describe_Entity()
|
||||
if (m_pInstance_ModelCom != nullptr)
|
||||
InstanceDesc = m_pInstance_ModelCom->Get_EffectValue();
|
||||
|
||||
m_pGameInstance->Asset_Description<CInstance_Model>(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL", (CComponent**)&m_pInstance_ModelCom, &InstanceDesc, this);
|
||||
_string strName = m_pGameInstance->Asset_Description<CInstance_Model>(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL", (CComponent**)&m_pInstance_ModelCom, &InstanceDesc, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strModelName = strName;
|
||||
}
|
||||
|
||||
if (m_pInstance_ModelCom != nullptr)
|
||||
{
|
||||
@@ -235,27 +449,30 @@ void CEditEffect::Describe_Entity()
|
||||
}
|
||||
|
||||
|
||||
if (m_isDiffuse == true)
|
||||
|
||||
|
||||
|
||||
if (m_EffectInfo.isDiffuse == true)
|
||||
{
|
||||
if (GUI::TreeNode("DIFFUSE"))
|
||||
{
|
||||
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::Checkbox("DiffuseUVMove", &m_isDiffuseUVMove);
|
||||
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_vUVCutting);
|
||||
GUI::Checkbox("DiffuseUVMove", &m_EffectInfo.isDiffuseUVMove);
|
||||
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_EffectInfo.vUVCutting);
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_vDiffuseUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_EffectInfo.vDiffuseUVGainAmount, 0.01f);
|
||||
|
||||
|
||||
|
||||
_int iDiffuseMoveLerpOption = (_int)m_iDiffuseMoveLerpOption;
|
||||
_int iDiffuseMoveLerpOption = (_int)m_EffectInfo.iDiffuseMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iDiffuseMoveLerpOption = iDiffuseMoveLerpOption;
|
||||
m_EffectInfo.iDiffuseMoveLerpOption = iDiffuseMoveLerpOption;
|
||||
}
|
||||
|
||||
GUI::Spacing();
|
||||
@@ -264,7 +481,13 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
if (GUI::TreeNode("DIFFUSE_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strDiffuseName = strName;
|
||||
}
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
@@ -275,27 +498,27 @@ void CEditEffect::Describe_Entity()
|
||||
}
|
||||
|
||||
|
||||
if (m_isMasking == true)
|
||||
if (m_EffectInfo.isMasking == true)
|
||||
{
|
||||
if (GUI::TreeNode("MASKING"))
|
||||
{
|
||||
|
||||
GUI::InputFloat2("MaskUVCutting", (_float*)&m_vUVMaskCutting);
|
||||
GUI::Checkbox("MaskUVMove", &m_isMaskUVMove);
|
||||
GUI::InputFloat2("MaskUVCutting", (_float*)&m_EffectInfo.vUVMaskCutting);
|
||||
GUI::Checkbox("MaskUVMove", &m_EffectInfo.isMaskUVMove);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_vMaskingUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_EffectInfo.vMaskingUVGainAmount, 0.01f);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
|
||||
_int iMaskMoveLerpOption = (_int)m_iMaskMoveLerpOption;
|
||||
_int iMaskMoveLerpOption = (_int)m_EffectInfo.iMaskMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iMaskMoveLerpOption = iMaskMoveLerpOption;
|
||||
m_EffectInfo.iMaskMoveLerpOption = iMaskMoveLerpOption;
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +526,12 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
if (GUI::TreeNode("MASKING_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strMaskingName = strName;
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
GUI::Separator(); GUI::Spacing();
|
||||
@@ -312,13 +540,18 @@ void CEditEffect::Describe_Entity()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_isDissolve == true)
|
||||
if (m_EffectInfo.isDissolve == true)
|
||||
{
|
||||
if (GUI::TreeNode("DISSOLVE"))
|
||||
{
|
||||
if (GUI::TreeNode("DISSOLV_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this);
|
||||
_string strName = m_strDissolveName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strDissolveName = strName;
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
GUI::Separator(); GUI::Spacing();
|
||||
@@ -327,34 +560,34 @@ void CEditEffect::Describe_Entity()
|
||||
}
|
||||
|
||||
}
|
||||
if (m_isNoise == true)
|
||||
if (m_EffectInfo.isNoise == true)
|
||||
{
|
||||
if (GUI::TreeNode("NOISE"))
|
||||
{
|
||||
ImGui::PushItemWidth(80);
|
||||
|
||||
GUI::DragFloat("NoiseDistortionIntensity", &m_fNoiseDistortionIntensity, 0.005f, 0.f, 1.f);
|
||||
GUI::DragFloat("NoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, 0.005f, 0.f, 1.f);
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_vDiffuseNoiseUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_EffectInfo.vDiffuseNoiseUVGainAmount, 0.01f);
|
||||
|
||||
_int iDiffuseNoiseMoveLerpOption = (_int)m_iDiffuseNoiseMoveLerpOption;
|
||||
_int iDiffuseNoiseMoveLerpOption = (_int)m_EffectInfo.iDiffuseNoiseMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp DiffuseNoiseMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption;
|
||||
m_EffectInfo.iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption;
|
||||
}
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_vMaskNoiseUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_EffectInfo.vMaskNoiseUVGainAmount, 0.01f);
|
||||
|
||||
_int iMaskNoiseMoveLerpOption = (_int)m_iMaskNoiseMoveLerpOption;
|
||||
_int iMaskNoiseMoveLerpOption = (_int)m_EffectInfo.iMaskNoiseMoveLerpOption;
|
||||
|
||||
if (ImGui::Combo("Lerp MaskNoiseMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9))
|
||||
{
|
||||
m_iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption;
|
||||
m_EffectInfo.iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption;
|
||||
}
|
||||
|
||||
GUI::Spacing();
|
||||
@@ -363,7 +596,11 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
if (GUI::TreeNode("NOISE_TEX"))
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
|
||||
|
||||
if (strName != "") {
|
||||
m_strNoiseName = strName;
|
||||
}
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "EffectObject.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -62,11 +62,11 @@ HRESULT CEffectObject::Render_Blur()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_fBlurIntensity, sizeof(_float)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_EffectInfo.fBlurIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_iBlurWeight, sizeof(_int)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_EffectInfo.iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -95,6 +95,200 @@ HRESULT CEffectObject::Render_Blur()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel)
|
||||
{
|
||||
_string strPerfectFilePath = pFilePath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
|
||||
HANDLE hFile = CreateFileW(
|
||||
CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름
|
||||
GENERIC_READ, // 읽기 모드
|
||||
FILE_SHARE_READ, // 다른 프로세스도 읽기 가능
|
||||
NULL,
|
||||
OPEN_EXISTING, // 기존 파일 열기
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL
|
||||
);
|
||||
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE) {
|
||||
MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
if (!ReadFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_EffectInfo.LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION);
|
||||
m_EffectInfo.LightDesc.iLevel = ENUM_CLASS(eLevel);
|
||||
|
||||
if (m_EffectInfo.LightDesc.eType != LIGHT::DIRECTIONAL) // 0이 아닐때만 생성
|
||||
{
|
||||
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &m_EffectInfo.LightDesc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_EffectInfo.isDiffuse)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strDiffuseName = szName;
|
||||
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isNoise)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strNoiseName = szName;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isMasking)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMaskingName = szName;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isDissolve)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strDissolveName = szName;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName),
|
||||
reinterpret_cast<CComponent**>(&m_pDissolve_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_EffectInfo.isEmissive)
|
||||
{
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strEmissiveName = szName;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName),
|
||||
reinterpret_cast<CComponent**>(&m_pEmissive_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)(DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strModelName = szName;
|
||||
}
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName),
|
||||
reinterpret_cast<CComponent**>(&m_pInstance_ModelCom))))
|
||||
return E_FAIL;;
|
||||
|
||||
m_pInstance_ModelCom->Load_InstanceModel(hFile);
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CEffectObject::Bind_ShaderResources()
|
||||
{
|
||||
|
||||
@@ -110,91 +304,95 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_EffectInfo.isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_isMasking, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_EffectInfo.isMasking, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_isDissolve, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_EffectInfo.isDissolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_EffectInfo.isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_isDiffuseUVMove, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissive", &m_EffectInfo.isEmissive, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_isMaskUVMove, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_EffectInfo.isDiffuseUVMove, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_vColor, sizeof(_float4)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_EffectInfo.isMaskUVMove, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_vEmissive, sizeof(_float4)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fColorOption", &m_fColorOption, sizeof(_float)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_EffectInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_fEmissiveCutAlpha, sizeof(_float)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fColorOption", &m_EffectInfo.fColorOption, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_fNoiseDistortionIntensity, sizeof(_float)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_EffectInfo.fEmissiveCutAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_vDiffuseUVGainAmount, sizeof(_float2)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_vMaskingUVGainAmount, sizeof(_float2)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_EffectInfo.vDiffuseUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_EffectInfo.vMaskingUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseNoiseUVGainAmount", &m_vDiffuseNoiseUVGainAmount, sizeof(_float2)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseNoiseUVGainAmount", &m_EffectInfo.vDiffuseNoiseUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskNoiseUVGainAmount", &m_vMaskNoiseUVGainAmount, sizeof(_float2)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskNoiseUVGainAmount", &m_EffectInfo.vMaskNoiseUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_vUVCutting, sizeof(_float2)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_EffectInfo.vUVCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_vUVMaskCutting, sizeof(_float2)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_EffectInfo.vUVMaskCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_iMaskMoveLerpOption, sizeof(_int)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_EffectInfo.iMaskMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_iDiffuseMoveLerpOption, sizeof(_int)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_EffectInfo.iDiffuseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_iMaskNoiseMoveLerpOption, sizeof(_int)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_EffectInfo.iMaskNoiseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_iDiffuseNoiseMoveLerpOption, sizeof(_int)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_EffectInfo.iDiffuseNoiseMoveLerpOption, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -229,7 +427,16 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pEmissive_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pEmissive_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_EmissiveTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -245,7 +452,9 @@ HRESULT CEffectObject::Ready_Components(void* pArg)
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
//나중에 로드할 때 라이트를 값을 입력받아서 생성 하자
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -275,9 +484,13 @@ void CEffectObject::Free()
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pDissolve_TextureCom);
|
||||
SAFE_RELEASE(m_pEmissive_TextureCom);
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pInstance_ModelCom);
|
||||
|
||||
if(m_pLightCom != nullptr)
|
||||
SAFE_RELEASE(m_pLightCom);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Effect_Editor.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -113,14 +113,14 @@ void CEffect_Editor::ReadMaterials(const char* pDirectoryName)
|
||||
|
||||
_string ext = file.path().extension().string();
|
||||
|
||||
if (strcmp(ext.c_str(), ".txt")) // 텍스트 파일 일때만 빌드함
|
||||
if (strcmp(ext.c_str(), ".txt")) // 텍스트 파일 일때만 빌드함
|
||||
continue;
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
|
||||
|
||||
_wstring wstrFileName = file.path().stem().wstring(); // 파일명
|
||||
_wstring wstrFileName = file.path().stem().wstring(); // 파일명
|
||||
|
||||
|
||||
ReadMaterial(wstrFileName, szFilePath);
|
||||
@@ -138,35 +138,35 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
|
||||
|
||||
_wstring wstrFirstLine = {};
|
||||
|
||||
getline(wifs, wstrFirstLine); // 가장 위의 텍스트
|
||||
getline(wifs, wstrFirstLine); // 가장 위의 텍스트
|
||||
|
||||
//.기준으로 뒤에 이름을 지워야함
|
||||
//.기준으로 뒤에 이름을 지워야함
|
||||
size_t iPos = wstrFirstLine.find(L" ");
|
||||
|
||||
_wstring wstrParent = {};
|
||||
|
||||
wstrParent = wstrFirstLine.substr(0, iPos); // " " 이전만 남김
|
||||
wstrParent = wstrFirstLine.substr(0, iPos); // " " 이전만 남김
|
||||
|
||||
if (wstrParent == L"Parent") // 부모 머테리얼이 있는 객체였다면
|
||||
if (wstrParent == L"Parent") // 부모 머테리얼이 있는 객체였다면
|
||||
{
|
||||
_wstring wstrMatPath = wstrFirstLine;
|
||||
|
||||
_wstring wstrKeyword = L"VFX";
|
||||
|
||||
size_t iPos = wstrMatPath.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
|
||||
size_t iPos = wstrMatPath.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
|
||||
|
||||
if (iPos != _wstring::npos) {
|
||||
|
||||
_wstring wstrResult = wstrMatPath.substr(iPos + wstrKeyword.length()); // "VTX이후만 남김"
|
||||
_wstring wstrResult = wstrMatPath.substr(iPos + wstrKeyword.length()); // "VTX이후만 남김"
|
||||
_wstring wstrMatName = {};
|
||||
|
||||
|
||||
//.기준으로 뒤에 이름을 지워야함
|
||||
//.기준으로 뒤에 이름을 지워야함
|
||||
size_t iPos = wstrResult.find(L".");
|
||||
|
||||
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
|
||||
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
|
||||
|
||||
//파일이름 받아오기
|
||||
//파일이름 받아오기
|
||||
size_t iNamePos = wstrResult.rfind(L"/");
|
||||
wstrMatName = wstrResult.substr(iNamePos + 1);
|
||||
|
||||
@@ -175,18 +175,18 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
|
||||
ReadMaterial(wstrMatName, CMyTools::ToString(wstrResult).c_str());
|
||||
|
||||
|
||||
// 상위 머테리얼 파일에서 넣었던 파일을 다시 내 파일로 담는다
|
||||
// 상위 머테리얼 파일에서 넣었던 파일을 다시 내 파일로 담는다
|
||||
auto Superior_iter = m_MatFiles.find(wstrMatName);
|
||||
auto Recent_iter = m_MatFiles.find(wstrFileName);
|
||||
|
||||
|
||||
if (m_MatFiles.end() != Superior_iter) // 경로가 존재한다면
|
||||
if (m_MatFiles.end() != Superior_iter) // 경로가 존재한다면
|
||||
{
|
||||
for (auto& wstrPath : Superior_iter->second) // 상위 머테리얼 벡터를 순회하여 내 벡터에 넣자
|
||||
for (auto& wstrPath : Superior_iter->second) // 상위 머테리얼 벡터를 순회하여 내 벡터에 넣자
|
||||
{
|
||||
_bool isExist = { false };
|
||||
|
||||
for (auto TextureInfo : Recent_iter->second) //이미 존재한 경로였다면 추가하지 않는다
|
||||
for (auto TextureInfo : Recent_iter->second) //이미 존재한 경로였다면 추가하지 않는다
|
||||
{
|
||||
|
||||
if (TextureInfo.first == wstrPath.first)
|
||||
@@ -205,13 +205,13 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
|
||||
m_MatFiles.erase(Superior_iter);
|
||||
}
|
||||
|
||||
//벡터에 모두 넣었다면 상위 머테리얼을 지운다
|
||||
//벡터에 모두 넣었다면 상위 머테리얼을 지운다
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 텍스쳐를 불러오자
|
||||
// 텍스쳐를 불러오자
|
||||
_wstring wstrTextureLine = {};
|
||||
|
||||
while (getline(wifs, wstrTextureLine))
|
||||
@@ -219,34 +219,34 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
|
||||
|
||||
_wstring wstrKeyword = L"/VFX";
|
||||
|
||||
size_t iPos = wstrTextureLine.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
|
||||
size_t iPos = wstrTextureLine.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
|
||||
|
||||
if (iPos != _wstring::npos) {
|
||||
|
||||
_wstring wstrResult = wstrTextureLine.substr(iPos); // "VTX이후만 남김"
|
||||
_wstring wstrResult = wstrTextureLine.substr(iPos); // "VTX이후만 남김"
|
||||
_wstring wstrTextureName = {};
|
||||
|
||||
//.기준으로 뒤에 이름을 지워야함
|
||||
//.기준으로 뒤에 이름을 지워야함
|
||||
size_t iPos = wstrResult.find(L".");
|
||||
|
||||
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
|
||||
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
|
||||
|
||||
// 이름 만들기
|
||||
// 이름 만들기
|
||||
size_t iNamePos = wstrResult.rfind(L"/");
|
||||
wstrTextureName = wstrResult.substr(iNamePos + 1);
|
||||
|
||||
wstrResult = L"../Bin/Resources" + wstrResult + L".png";
|
||||
|
||||
//경로를 담는다
|
||||
//경로를 담는다
|
||||
auto iter = m_MatFiles.find(wstrFileName);
|
||||
|
||||
if (m_MatFiles.end() != iter) // 경로가 존재한다면
|
||||
if (m_MatFiles.end() != iter) // 경로가 존재한다면
|
||||
{
|
||||
_bool isExist = { false };
|
||||
|
||||
for (auto TextureInfo : iter->second)
|
||||
{
|
||||
if (TextureInfo.first == wstrTextureName) // 이미 존재했었다면
|
||||
if (TextureInfo.first == wstrTextureName) // 이미 존재했었다면
|
||||
{
|
||||
isExist = true;
|
||||
break;
|
||||
@@ -263,9 +263,10 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
|
||||
wifs.close();
|
||||
}
|
||||
|
||||
void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject)
|
||||
_string CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject)
|
||||
{
|
||||
|
||||
_string strName = {};
|
||||
for (auto iter : m_MatFiles)
|
||||
{
|
||||
if (GUI::TreeNode(CMyTools::ToString(iter.first).c_str()))
|
||||
@@ -273,14 +274,17 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameOb
|
||||
|
||||
for (auto wstrTextureInfo : iter.second)
|
||||
{
|
||||
m_pGameInstance->Asset_Description<CTexture>(
|
||||
strName = m_pGameInstance->Asset_Description<CTexture>(
|
||||
ENUM_CLASS(LEVEL::EFFECT),
|
||||
CMyTools::ToString(iter.first).c_str()
|
||||
, pTexture
|
||||
, nullptr
|
||||
, pObject
|
||||
, wstrTextureInfo.first // 이름
|
||||
, wstrTextureInfo.first // 이름
|
||||
);
|
||||
|
||||
if(strName != "")
|
||||
return strName;
|
||||
};
|
||||
|
||||
|
||||
@@ -291,7 +295,24 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameOb
|
||||
}
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
HRESULT CEffect_Editor::Load_Edit(const _char* pPath)
|
||||
{
|
||||
|
||||
if (m_pEditEffect == nullptr)
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pEditEffect->Load(pPath, LEVEL::EFFECT)))
|
||||
{
|
||||
Safe_Release(m_pEditEffect);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
Safe_Release(m_pEditEffect);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,6 +358,22 @@ void CEffect_Editor::Describe_Entity()
|
||||
if (m_pEditEffect != nullptr)
|
||||
m_pEditEffect->Describe_Entity();
|
||||
|
||||
GUI::InputTextMultiline("FILE PATH", m_szBuffer, sizeof(m_szBuffer), ImVec2(250, 25));
|
||||
|
||||
m_strSavePath = m_szBuffer;
|
||||
|
||||
if (GUI::Button("SAVE"))
|
||||
{
|
||||
m_pEditEffect->Save_Effect(m_strSavePath.c_str());
|
||||
}
|
||||
|
||||
GUI::SameLine();
|
||||
|
||||
if (GUI::Button("LOAD"))
|
||||
{
|
||||
Load_Edit(m_strSavePath.c_str());
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Begin("Reference Material");
|
||||
@@ -395,7 +432,7 @@ void CEffect_Editor::Describe_Entity()
|
||||
if (ImGui::MenuItem("Delete Effect"))
|
||||
{
|
||||
auto iter = m_PartObjects.begin();
|
||||
advance(iter, iIndex); // 이터레이터를 증가시킨다
|
||||
advance(iter, iIndex); // 이터레이터를 증가시킨다
|
||||
|
||||
SAFE_RELEASE(pPartObject.second);
|
||||
m_PartObjects.erase(iter);
|
||||
@@ -411,7 +448,7 @@ void CEffect_Editor::Describe_Entity()
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (GUI::IsItemClicked()) // 선택창에 띄우기
|
||||
if (GUI::IsItemClicked()) // 선택창에 띄우기
|
||||
{
|
||||
CEditEffect* pSelectedEffectObject = dynamic_cast<CEditEffect*>(pPartObject.second);
|
||||
|
||||
@@ -432,11 +469,11 @@ void CEffect_Editor::Describe_Entity()
|
||||
|
||||
|
||||
|
||||
Safe_Release(m_pEditEffect);
|
||||
SAFE_RELEASE(m_pEditEffect);
|
||||
|
||||
m_pEditEffect = pSelectedEffectObject;
|
||||
|
||||
Safe_AddRef(pSelectedEffectObject);
|
||||
SAFE_ADDREF(pSelectedEffectObject);
|
||||
|
||||
m_strCurrentEffectName = strName;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "GamePlay_Canvas.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Mission_Panel.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Hair.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -136,7 +136,7 @@ CHair* CHair::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CHair");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -149,7 +149,7 @@ CGameObject* CHair::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CHair");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -146,7 +146,7 @@ CHead* CHead::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CHead");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -159,7 +159,7 @@ CGameObject* CHead::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CHead");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "IMGUIUI.h"
|
||||
#include "UIObject.h"
|
||||
#include "GamePlay_Canvas.h"
|
||||
@@ -38,7 +38,7 @@ void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
|
||||
|
||||
for (auto& wname : panelNames)
|
||||
{
|
||||
// wstring -> UTF-8 string 변환
|
||||
// wstring -> UTF-8 string 변환
|
||||
int size = WideCharToMultiByte(CP_UTF8, 0,
|
||||
wname.c_str(), (int)wname.size(),
|
||||
nullptr, 0, nullptr, nullptr);
|
||||
@@ -49,11 +49,11 @@ void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
|
||||
wname.c_str(), (int)wname.size(),
|
||||
&result[0], size, nullptr, nullptr);
|
||||
|
||||
// 변환된 string 저장
|
||||
// 변환된 string 저장
|
||||
m_iPanelNamestring.push_back(std::move(result));
|
||||
}
|
||||
|
||||
// vector<const char*> 업데이트
|
||||
// vector<const char*> 업데이트
|
||||
for (auto& str : m_iPanelNamestring)
|
||||
m_iPanelName.push_back(str.c_str());
|
||||
|
||||
@@ -70,7 +70,7 @@ void CIMGUIUI::ElementwstringTostring(vector<wstring>& panelNames)
|
||||
|
||||
for (auto& wname : panelNames)
|
||||
{
|
||||
// wstring -> UTF-8 string 변환
|
||||
// wstring -> UTF-8 string 변환
|
||||
int size = WideCharToMultiByte(CP_UTF8, 0,
|
||||
wname.c_str(), (int)wname.size(),
|
||||
nullptr, 0, nullptr, nullptr);
|
||||
@@ -81,11 +81,11 @@ void CIMGUIUI::ElementwstringTostring(vector<wstring>& panelNames)
|
||||
wname.c_str(), (int)wname.size(),
|
||||
&result[0], size, nullptr, nullptr);
|
||||
|
||||
// 변환된 string 저장
|
||||
// 변환된 string 저장
|
||||
m_pElementNamestring.push_back(std::move(result));
|
||||
}
|
||||
|
||||
// vector<const char*> 업데이트
|
||||
// vector<const char*> 업데이트
|
||||
for (auto& str : m_pElementNamestring)
|
||||
m_pElementName.push_back(str.c_str());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
|
||||
#include "Information.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Effect_Editor.h"
|
||||
#include "Dummy_Cube.h"
|
||||
#include "MainLight.h"
|
||||
#include "Dummy_Plane.h"
|
||||
|
||||
CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -36,6 +37,9 @@ HRESULT CLevel_EffectViewer::Initialize()
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Cube>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Plane>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "TestEffect.h"
|
||||
#include "EditEffect.h"
|
||||
#include "Effect_Editor.h"
|
||||
#include "Dummy_Plane.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -475,6 +476,10 @@ HRESULT CLoader::Loading_For_Effect()
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Model_DummyPlane"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
|
||||
m_strMessage = TEXT("Shader Loading..");
|
||||
@@ -509,6 +514,10 @@ HRESULT CLoader::Loading_For_Effect()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(ENUM_CLASS(LEVEL::EFFECT), CDummy_Cube::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Plane>(ENUM_CLASS(LEVEL::EFFECT), CDummy_Plane::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
m_strMessage = TEXT("Loading Success!");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "MapObject_LOD.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -222,10 +222,10 @@ void CMapObject_LOD::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
|
||||
for(auto& pModel : m_pModelComs)
|
||||
Safe_Release(pModel);
|
||||
SAFE_RELEASE(pModel);
|
||||
m_pModelComs.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -1084,7 +1084,7 @@ CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11Devi
|
||||
if (FAILED(pInstance->Initialize_Prototype(ModelPrototypeTags, ModelPrototypePaths)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMapObject_Manager");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -1097,7 +1097,7 @@ CGameObject* CMapObject_Manager::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CMapObject_Manager");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "MapObject_Static.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -192,8 +192,8 @@ void CMapObject_Static::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CMapObject_Static::Describe_Entity()
|
||||
|
||||
@@ -144,8 +144,8 @@ void CModelParts::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CModelParts::Describe_Entity()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Monster.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -129,7 +129,7 @@ CMonster* CMonster::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMonster");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -142,7 +142,7 @@ CGameObject* CMonster::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CMonster");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -154,8 +154,8 @@ void CMonster::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
|
||||
void CMonster::Describe_Entity()
|
||||
|
||||
@@ -171,7 +171,7 @@ CRootModelPart* CRootModelPart::Create(ID3D11Device* pDevice, ID3D11DeviceContex
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CRootModelPart");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -184,7 +184,7 @@ CGameObject* CRootModelPart::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CRootModelPart");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Terrain.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
@@ -126,7 +126,7 @@ CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CTerrain");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -139,7 +139,7 @@ CGameObject* CTerrain::Clone(void* pArg, CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CTerrain");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -149,9 +149,9 @@ void CTerrain::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pVIBufferCom);
|
||||
Safe_Release(m_pTextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
SAFE_RELEASE(m_pTextureCom);
|
||||
}
|
||||
|
||||
void CTerrain::Describe_Entity()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "ElementObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "Camera.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
@@ -34,8 +34,8 @@ class CDummyObject final : public CGameObject
|
||||
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
_wstring m_strModelPrototypeTag;
|
||||
_bool m_bRimLight = { true };
|
||||
_float m_fRimLightPower = { 3.2f };
|
||||
@@ -53,4 +53,4 @@ class CDummyObject final : public CGameObject
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_Plane final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CDummy_Plane(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_Plane(const CDummy_Plane& rhs);
|
||||
virtual ~CDummy_Plane() = 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:
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CDummy_Plane* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "EffectObject.h"
|
||||
@@ -23,8 +23,8 @@ class CEditEffect final : public CEffectObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
public:
|
||||
void Reference_Mat_For_EditEffect();
|
||||
|
||||
void Reference_Mat_For_EditEffect();
|
||||
HRESULT Save_Effect(const _char* pPath);
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
@@ -39,4 +39,4 @@ class CEditEffect final : public CEffectObject
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "PartObject.h"
|
||||
@@ -7,12 +7,56 @@ NS_BEGIN(Engine)
|
||||
class CInstance_Model;
|
||||
class CShader;
|
||||
class CTexture;
|
||||
class CLight;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CEffectObject abstract : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagEffectInfo
|
||||
{
|
||||
_float4 vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
_float2 vDiffuseUVGainAmount = {};
|
||||
_float2 vMaskingUVGainAmount = {};
|
||||
|
||||
_float2 vDiffuseNoiseUVGainAmount = {};
|
||||
_float2 vMaskNoiseUVGainAmount = {};
|
||||
|
||||
_float2 vUVCutting = { 1.f ,1.f };
|
||||
_float2 vUVMaskCutting = { 1.f ,1.f };
|
||||
|
||||
_int iMaskMoveLerpOption = { 0 };
|
||||
_int iDiffuseMoveLerpOption = { 0 };
|
||||
_int iMaskNoiseMoveLerpOption = { 0 };
|
||||
_int iDiffuseNoiseMoveLerpOption = { 0 };
|
||||
_int iBlurWeight = { 0 };
|
||||
|
||||
|
||||
_bool isDiffuse = {};
|
||||
_bool isMasking = {};
|
||||
_bool isDissolve = {};
|
||||
_bool isNoise = {};
|
||||
_bool isEmissive = {};
|
||||
_bool isDiffuseUVMove = {};
|
||||
_bool isMaskUVMove = {};
|
||||
_bool isBlur = {};
|
||||
_bool isBillboard = {};
|
||||
|
||||
|
||||
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
_float fColorOption = {};
|
||||
_float fBlurIntensity = {};
|
||||
_float fNoiseDistortionIntensity = {};
|
||||
_float fEmissiveCutAlpha = {};
|
||||
|
||||
LIGHT_DESC LightDesc = {};
|
||||
RENDER eRenderOrder = { RENDER::EFFECT };
|
||||
|
||||
}EFFECT_INFO;
|
||||
|
||||
protected:
|
||||
CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CEffectObject(const CEffectObject& rhs);
|
||||
@@ -24,6 +68,8 @@ class CEffectObject abstract : public CPartObject
|
||||
virtual void Late_Update(_float fTimeDelta);
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Blur() override;
|
||||
public:
|
||||
HRESULT Load(const _char* pFilePath, LEVEL eLevel);
|
||||
protected:
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
@@ -35,50 +81,24 @@ class CEffectObject abstract : public CPartObject
|
||||
CTexture* m_pNoise_TextureCom = { nullptr };
|
||||
CTexture* m_pMasking_TextureCom = { nullptr };
|
||||
CTexture* m_pDissolve_TextureCom = { nullptr };
|
||||
CTexture* m_pEmissive_TextureCom = { nullptr };
|
||||
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CLight* m_pLightCom = { nullptr };
|
||||
|
||||
CInstance_Model* m_pInstance_ModelCom = { nullptr };
|
||||
|
||||
protected:
|
||||
_float4 m_vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
_float2 m_vDiffuseUVGainAmount = {};
|
||||
_float2 m_vMaskingUVGainAmount = {};
|
||||
|
||||
_float2 m_vDiffuseNoiseUVGainAmount = {};
|
||||
_float2 m_vMaskNoiseUVGainAmount = {};
|
||||
|
||||
_float2 m_vUVCutting = { 1.f ,1.f };
|
||||
_float2 m_vUVMaskCutting = { 1.f ,1.f };
|
||||
|
||||
_int m_iMaskMoveLerpOption = { 0 };
|
||||
_int m_iDiffuseMoveLerpOption = { 0 };
|
||||
_int m_iMaskNoiseMoveLerpOption = { 0 };
|
||||
_int m_iDiffuseNoiseMoveLerpOption = { 0 };
|
||||
_int m_iBlurWeight = { 0 };
|
||||
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isMasking = {};
|
||||
_bool m_isDissolve = {};
|
||||
_bool m_isNoise = {};
|
||||
_bool m_isDiffuseUVMove = {};
|
||||
_bool m_isMaskUVMove = {};
|
||||
_bool m_isBlur = {};
|
||||
_bool m_isBillboard = {};
|
||||
|
||||
|
||||
_float4 m_vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
_float m_fColorOption = {};
|
||||
_float m_fBlurIntensity = {};
|
||||
_float m_fNoiseDistortionIntensity = {};
|
||||
_float m_fEmissiveCutAlpha = {};
|
||||
|
||||
|
||||
RENDER m_eRenderOrder = { RENDER::EFFECT };
|
||||
EFFECT_INFO m_EffectInfo = {};
|
||||
_string m_strDiffuseName = {};
|
||||
_string m_strNoiseName = {};
|
||||
_string m_strMaskingName = {};
|
||||
_string m_strDissolveName = {};
|
||||
_string m_strModelName = {};
|
||||
_string m_strEmissiveName = {};
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "ContainerObject.h"
|
||||
@@ -23,7 +23,8 @@ class CEffect_Editor final : public CContainerObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
public:
|
||||
void Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject);
|
||||
_string Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject);
|
||||
HRESULT Load_Edit(const _char* pPath);
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
@@ -37,9 +38,13 @@ class CEffect_Editor final : public CContainerObject
|
||||
|
||||
private:
|
||||
_string m_strCurrentEffectName = {};
|
||||
|
||||
_uint m_iNumPart = { 0 };
|
||||
class CEditEffect* m_pEditEffect = { nullptr };
|
||||
map<_wstring, vector<pair<_wstring, _wstring>>> m_MatFiles = {}; // map<머테리얼 이름, vector<텍스쳐이름 , 텍스쳐 경로>>
|
||||
map<_wstring, vector<pair<_wstring, _wstring>>> m_MatFiles = {}; // map<머테리얼 이름, vector<텍스쳐이름 , 텍스쳐 경로>>
|
||||
|
||||
_char m_szBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/"};
|
||||
_string m_strSavePath = {};
|
||||
|
||||
public:
|
||||
static CEffect_Editor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -50,4 +55,4 @@ class CEffect_Editor final : public CContainerObject
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "CanvasObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
#include "Editor_Define.h"
|
||||
@@ -15,7 +15,7 @@ typedef class CInformation final : public CBase
|
||||
_bool strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents);
|
||||
_bool wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents);
|
||||
|
||||
#pragma endregion // 전역
|
||||
#pragma endregion // 전역
|
||||
|
||||
#pragma region OBJECTVIEWER
|
||||
|
||||
|
||||
@@ -19,8 +19,11 @@ float g_fSpotOuterAngle;
|
||||
|
||||
vector g_vLightDir;
|
||||
vector g_vLightPos;
|
||||
vector g_vLightPosOffset;
|
||||
|
||||
vector g_vCamPosition;
|
||||
|
||||
|
||||
Texture2D g_NormalTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_ShadeTexture;
|
||||
@@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
|
||||
vector vLightDir = vPosition - g_vLightPos;
|
||||
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
|
||||
float fDistance = length(vLightDir);
|
||||
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
|
||||
if (fAttenuation <= 0.f)
|
||||
|
||||
@@ -203,6 +203,7 @@ call Update_Lib.bat
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Collider.cpp" />
|
||||
<ClCompile Include="..\Private\Collider_Manager.cpp" />
|
||||
<ClCompile Include="..\Private\Collision_Callback.cpp" />
|
||||
<ClCompile Include="..\Private\Component.cpp" />
|
||||
<ClCompile Include="..\Private\ComputeShader.cpp" />
|
||||
<ClCompile Include="..\Private\ContainerObject.cpp" />
|
||||
@@ -418,6 +419,7 @@ call Update_Lib.bat
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Collider.h" />
|
||||
<ClInclude Include="..\Public\Collider_Manager.h" />
|
||||
<ClInclude Include="..\Public\Collision_Callback.h" />
|
||||
<ClInclude Include="..\Public\Component.h" />
|
||||
<ClInclude Include="..\Public\ComputeShader.h" />
|
||||
<ClInclude Include="..\Public\ContainerObject.h" />
|
||||
|
||||
@@ -244,6 +244,18 @@
|
||||
<Filter Include="01.Utility\06.Picking">
|
||||
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\08.Character_Controller\Collision_Callback">
|
||||
<UniqueIdentifier>{05865481-fa20-4432-a5a7-945d4f8c7f3c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\10.Dynamic">
|
||||
<UniqueIdentifier>{bed0de44-4e62-4b5f-9767-65cfc8a933a3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\11.Kinematic">
|
||||
<UniqueIdentifier>{33ac85a2-be8e-4ad9-a179-1239d818dc9c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\07.RigidBody\00.Static">
|
||||
<UniqueIdentifier>{fda41884-634b-4dd4-8bd2-f6f7ad68ab1f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\09.Light">
|
||||
<UniqueIdentifier>{7c82051e-19af-4284-8156-16f504db30b6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -465,6 +477,9 @@
|
||||
<ClCompile Include="..\Private\Light_Manager.cpp">
|
||||
<Filter>03.Management\03.Light_Manager</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Collision_Callback.cpp">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\Collision_Callback</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Base.h">
|
||||
@@ -1046,6 +1061,9 @@
|
||||
<ClInclude Include="..\Public\Light_Manager.h">
|
||||
<Filter>03.Management\03.Light_Manager</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Collision_Callback.h">
|
||||
<Filter>02.Element\02.Component\08.Character_Controller\Collision_Callback</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Public\Assimp\color4.inl">
|
||||
|
||||
@@ -269,7 +269,7 @@ CAnimation* CAnimation::Create(const CModel* pModel, SaveAnimation* pSaveAnimati
|
||||
if (FAILED(pInstance->Initialize(pModel, pSaveAnimation)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CAnimation");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Base.h"
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Bone.h"
|
||||
|
||||
CBone::CBone()
|
||||
@@ -76,7 +76,7 @@ CBone* CBone::Create(const SaveNode& _SaveNode, _int iParentIndex)
|
||||
if (FAILED(pInstance->Initialize(_SaveNode, iParentIndex)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CBone");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
|
||||
#include "Bounding.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Bounding_AABB.h"
|
||||
#include "Bounding_OBB.h"
|
||||
#include "Bounding_Sphere.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Bounding_AABB.h"
|
||||
#include "Bounding_OBB.h"
|
||||
#include "Bounding_Sphere.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Bounding_AABB.h"
|
||||
#include "Bounding_OBB.h"
|
||||
#include "Bounding_Sphere.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "CanvasObject.h"
|
||||
|
||||
CCanvasObject::CCanvasObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -144,5 +144,5 @@ void CCanvasObject::Free()
|
||||
|
||||
m_Panels.clear();
|
||||
m_PanelNames.clear();
|
||||
m_Panels_map.clear(); // map 비우기
|
||||
m_Panels_map.clear(); // map 비우기
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Cell.h"
|
||||
|
||||
#include "VIBuffer_Cell.h"
|
||||
@@ -44,7 +44,7 @@ _ubyte CCell::Get_CellAttribute()
|
||||
HRESULT CCell::Initialize(const _float3* pPoints, _uint iIndex)
|
||||
{
|
||||
if (nullptr == pPoints) {
|
||||
return S_OK; // 로딩 전용
|
||||
return S_OK; // 로딩 전용
|
||||
}
|
||||
memcpy(m_vPoints, pPoints, sizeof(_float3) * ENUM_CLASS(NAVI_POINT::END));
|
||||
|
||||
@@ -153,7 +153,7 @@ HRESULT CCell::LoadAsBinary(HANDLE hFile, DWORD& dwByte, _uint iCellIndex)
|
||||
HRESULT CCell::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
if (UINT_MAX == m_iIndex) {
|
||||
assert(false); // 초기화 되지 않은 정점 저장 시도
|
||||
assert(false); // 초기화 되지 않은 정점 저장 시도
|
||||
return E_FAIL;
|
||||
}
|
||||
WriteFile(hFile, m_vPoints, sizeof(_float3) * ENUM_CLASS(NAVI_POINT::END), &dwByte, nullptr);
|
||||
|
||||
@@ -299,7 +299,7 @@ CChannel* CChannel::Create(const CModel* pModel, SaveChannel* pSaveChannel)
|
||||
if (FAILED(pInstance->Initialize(pModel, pSaveChannel)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CChannel");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Collision_Callback.h"
|
||||
|
||||
CCharacter_Controller::CCharacter_Controller(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CComponent{ pDevice, pContext }
|
||||
@@ -62,6 +63,11 @@ HRESULT CCharacter_Controller::Render()
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
void CCharacter_Controller::Resize_Volume(_float fHeight)
|
||||
{
|
||||
m_pController->resize(fHeight);
|
||||
}
|
||||
|
||||
void CCharacter_Controller::Modify_Volume(_float3 fVolume)
|
||||
{
|
||||
switch (m_eBodyType)
|
||||
@@ -129,18 +135,13 @@ _float3 CCharacter_Controller::Get_Volume()
|
||||
|
||||
void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
{
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
_float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? )
|
||||
_vector vMomentum = m_pTransform->Get_CurrentMomentum();
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, vMomentum);
|
||||
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량
|
||||
_float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? )
|
||||
PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum());
|
||||
|
||||
// eCOLLISION_SIDES = (1 << 0), //!< Character is colliding to the sides.
|
||||
// eCOLLISION_UP = (1 << 1), //!< Character has collision above.
|
||||
// eCOLLISION_DOWN = (1 << 2) //!< Character has collision below.
|
||||
m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles);
|
||||
|
||||
|
||||
@@ -171,11 +172,6 @@ _float3 CCharacter_Controller::Get_FootPosition()
|
||||
return { (_float)pxLVecfootPos.x, (_float)pxLVecfootPos.y, (_float)pxLVecfootPos.z };
|
||||
}
|
||||
|
||||
void CCharacter_Controller::Resize_Volume(_float fHeight)
|
||||
{
|
||||
m_pController->resize(fHeight);
|
||||
}
|
||||
|
||||
HRESULT CCharacter_Controller::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
@@ -184,55 +180,90 @@ HRESULT CCharacter_Controller::Initialize_Prototype()
|
||||
HRESULT CCharacter_Controller::Initialize(void* pArg)
|
||||
{
|
||||
Character_Controller_DESC* pDesc = static_cast<Character_Controller_DESC*>(pArg);
|
||||
m_eBodyType = pDesc->eBodyType;
|
||||
m_bAutoStepping = pDesc->bAutoStepping;
|
||||
m_pTransform = pDesc->pTransform;
|
||||
{ // Character_Controller_DESC
|
||||
m_eBodyType = pDesc->eBodyType;
|
||||
m_bAutoStepping = pDesc->bAutoStepping;
|
||||
m_pTransform = pDesc->pTransform;
|
||||
|
||||
}
|
||||
{ // PhsXUserData
|
||||
m_tagData.eKind = PHYSX_KIND::CCTActor;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pCharacter = this;
|
||||
}
|
||||
|
||||
switch (m_eBodyType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
{
|
||||
PSX::PxBoxControllerDesc Desc{};
|
||||
Desc.halfHeight = {};
|
||||
Desc.halfSideExtent = {};
|
||||
Desc.halfForwardExtent = {};
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_BoxController(Desc);
|
||||
#ifdef _DEBUG
|
||||
_float3 vVolume = Get_Volume();
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vVolume, false, false));
|
||||
#endif // _DEBUG
|
||||
Desc.halfHeight = pDesc->vBoxSize.y;
|
||||
Desc.halfSideExtent = pDesc->vBoxSize.x;
|
||||
Desc.halfForwardExtent = pDesc->vBoxSize.z;
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.reportCallback = static_cast<PSX::PxUserControllerHitReport*>(pDesc->pCallback);
|
||||
Desc.behaviorCallback = static_cast<PSX::PxControllerBehaviorCallback*>(pDesc->pCallback);
|
||||
Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_BoxController(Desc);
|
||||
m_pController->setUserData(&m_tagData);
|
||||
} break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
{
|
||||
PSX::PxCapsuleControllerDesc Desc{};
|
||||
Desc.radius = pDesc->tCapsuleInfo.fRadius;
|
||||
Desc.height = pDesc->tCapsuleInfo.fHeight;
|
||||
Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 기본 eEASY
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
|
||||
#ifdef _DEBUG
|
||||
_float3 vVolume = Get_Volume();
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, vVolume.x, 10, false, false));
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, vVolume.y, vVolume.x, 10, false));
|
||||
#endif // _DEBUG
|
||||
Desc.radius = pDesc->fRadius;
|
||||
Desc.height = pDesc->fHeight;
|
||||
Desc.climbingMode = pDesc->eClimbingMode; // 기본 eEASY
|
||||
Desc.contactOffset = pDesc->fContactOffset;
|
||||
Desc.reportCallback = static_cast<PSX::PxUserControllerHitReport*>(pDesc->pCallback);
|
||||
Desc.behaviorCallback = static_cast<PSX::PxControllerBehaviorCallback*>(pDesc->pCallback);
|
||||
Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial);
|
||||
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
|
||||
m_pController->setUserData(&m_tagData);
|
||||
} break;
|
||||
default:
|
||||
assert(false); // PhysX에서 불가능
|
||||
return E_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (nullptr == m_pController) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pController->setSlopeLimit(m_fSlopeLimit);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Debug_Initialize())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CCharacter_Controller::Debug_Initialize()
|
||||
{
|
||||
_float3 vVolume = Get_Volume();
|
||||
switch (m_eBodyType)
|
||||
{
|
||||
case ACTOR::BOX:
|
||||
m_pMainShape = (GeometricPrimitive::CreateBox(m_pContext, vVolume, false, false));
|
||||
break;
|
||||
case ACTOR::CAPSULE:
|
||||
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, vVolume.y, vVolume.x, 10, false));
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, vVolume.x, 10, false, false));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
_bool CCharacter_Controller::Check_Overlap()
|
||||
{
|
||||
return _bool();
|
||||
@@ -295,6 +326,7 @@ void CCharacter_Controller::Describe_Entity()
|
||||
if (GUI::SliderFloat("StepOffset", &fStepOffset, 0.f, 3.f, "%.2f")) {
|
||||
m_pController->setStepOffset(fStepOffset);
|
||||
} GUIHelpMarker("In stepped regions, the tolerance height the controller can climb.\n Capsule behaves slightly differently.");
|
||||
|
||||
if (ACTOR::CAPSULE == m_eBodyType) {
|
||||
PSX::PxCapsuleController* pController = (PSX::PxCapsuleController*)m_pController;
|
||||
|
||||
@@ -317,6 +349,7 @@ void CCharacter_Controller::Describe_Entity()
|
||||
GUIHelpMarker("A capsule is affected by its lower sphere and tends to generate an up vector on steps.\nIn eEASY, the up vector is combined with the step offset, allowing easier climbing; in eCONSTRAINED, the up vector is removed during step detection and only the step offset is used.");
|
||||
}
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat3("Volume", (_float*)&vVolume, 0.1f, 10.f, "%.2f")) {
|
||||
Modify_Volume(vVolume);
|
||||
}GUIHelpMarker("Box uses vSize; Capsule uses x->fRadius, y->fHeight.\nThe capsule's fHeight is likely the distance from the lower sphere center to the upper sphere center.");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "Collider.h"
|
||||
#include "Collider.h"
|
||||
#include "pch.h"
|
||||
|
||||
#include "Collider.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Collider_Manager.h"
|
||||
#include "GameInstance.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
#include "pch.h"
|
||||
#include "Collision_Callback.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CCollision_Callback::CCollision_Callback()
|
||||
{
|
||||
}
|
||||
|
||||
void CCollision_Callback::onShapeHit(const PSX::PxControllerShapeHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // move 방향
|
||||
_float fLength = hit.length; // move 길이
|
||||
|
||||
PSX::PxShape* pShape = hit.shape;
|
||||
PSX::PxRigidActor* pActor = hit.actor;
|
||||
|
||||
|
||||
if (nullptr != pController && nullptr != pActor) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pActor->userData);
|
||||
assert(nullptr != pActor); // missing user data
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
// action
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCollision_Callback::onControllerHit(const PSX::PxControllersHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // move 방향
|
||||
_float fLength = hit.length; // move 길이
|
||||
|
||||
PSX::PxController* pOtherController= hit.other; // 다른 컨트롤러
|
||||
|
||||
if (nullptr != pController && nullptr != pOtherController) {
|
||||
PhsXUserData* pActorData = static_cast<PhsXUserData*>(pOtherController->getActor()->userData);
|
||||
assert(nullptr != pOtherController); // missing user data
|
||||
|
||||
switch (pActorData->eKind)
|
||||
{
|
||||
case PHYSX_KIND::BODY_STATIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::BODY_DYNAMIC:
|
||||
assert(false);
|
||||
break;
|
||||
case PHYSX_KIND::CCTActor:
|
||||
// Action
|
||||
break;
|
||||
case PHYSX_KIND::OBSTACLEActor:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCollision_Callback::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // move 방향
|
||||
_float fLength = hit.length; // move 길이
|
||||
|
||||
const void* pOtherController= hit.userData; // 장애물
|
||||
|
||||
//switch (pOtherController.member)
|
||||
//{
|
||||
//default:
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor)
|
||||
{
|
||||
//if (actor.userData.subKind == kMovingPlatformTag)
|
||||
// return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT
|
||||
// | PSX::PxControllerBehaviorFlag::eCCT_SLIDE;
|
||||
|
||||
// 나머지는 아무 특별 동작 없음
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxController& controller)
|
||||
{
|
||||
// CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴
|
||||
return PSX::PxControllerBehaviorFlags(0);
|
||||
}
|
||||
|
||||
PSX::PxControllerBehaviorFlags CCollision_Callback::getBehaviorFlags(const PSX::PxObstacle& obstacle)
|
||||
{
|
||||
// Obstacle이 움직이는 발판이다?
|
||||
// 여기서 ride/slide 세팅
|
||||
//return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT;
|
||||
|
||||
return PSX::PxControllerBehaviorFlags();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Component.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "ComputeShader.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Instance_Model.h"
|
||||
@@ -8,9 +8,9 @@ CComputeShader::CComputeShader(ID3D11Device* pDevice, ID3D11DeviceContext* pCont
|
||||
, m_pContext{ pContext }
|
||||
, m_pGameInstance{ CGameInstance::GetInstance() }
|
||||
{
|
||||
Safe_AddRef(m_pDevice);
|
||||
Safe_AddRef(m_pContext);
|
||||
Safe_AddRef(m_pGameInstance);
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
HRESULT CComputeShader::Initialize(const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iNumOutputBuffer, _uint iInputStructStride[], _uint iOutputStructStride[])
|
||||
@@ -37,10 +37,10 @@ vector<D3D11_MAPPED_SUBRESOURCE> CComputeShader::Dispatch(_uint iSRVIndex, _uint
|
||||
{
|
||||
//VBBuffer-> dynamic , pConstantBuffer-> dynamic , m_pInputBuffer, m_pOutputBuffer-> default , m_pStagingBuffer-> Staging
|
||||
|
||||
//내 시작 버퍼 값을 채운다.
|
||||
//내 시작 버퍼 값을 채운다.
|
||||
|
||||
//다이나믹으로 생성된 버퍼를 바로 디폴트 버퍼로 때려박을 수 없음
|
||||
//따라서 스테이징 버퍼를 따로 선언하여 값을 복사받는다.
|
||||
//다이나믹으로 생성된 버퍼를 바로 디폴트 버퍼로 때려박을 수 없음
|
||||
//따라서 스테이징 버퍼를 따로 선언하여 값을 복사받는다.
|
||||
|
||||
|
||||
for (_uint i = 0; i < m_iNumInputBuffer; i++)
|
||||
@@ -55,22 +55,22 @@ vector<D3D11_MAPPED_SUBRESOURCE> CComputeShader::Dispatch(_uint iSRVIndex, _uint
|
||||
|
||||
|
||||
|
||||
//컴퓨트 쉐이더 바인딩
|
||||
//컴퓨트 쉐이더 바인딩
|
||||
m_pContext->CSSetShader(m_pComputeShader, nullptr, 0);
|
||||
m_pContext->CSSetConstantBuffers(0, 1, &pConstantBuffer);
|
||||
|
||||
//SRV, UAV 바인딩
|
||||
//SRV, UAV 바인딩
|
||||
Bind_SRV(iSRVIndex);
|
||||
Bind_UAV(iUAVIndex);
|
||||
|
||||
//컴퓨트 쉐이더 실행
|
||||
//컴퓨트 쉐이더 실행
|
||||
|
||||
//내 버퍼의 차원(1,2,3차원 배열)에 따른 그룹 카운트를 설정 << 정확히 모르겠음
|
||||
//내 버퍼의 차원(1,2,3차원 배열)에 따른 그룹 카운트를 설정 << 정확히 모르겠음
|
||||
m_pContext->Dispatch((_uint)vGroupCount.x, (_uint)vGroupCount.y, (_uint)vGroupCount.z);
|
||||
|
||||
|
||||
//디폴트-> 스테이징 버퍼는 복사가 가능함 (다이나믹은 cpu 기반이라 복사 안됨)
|
||||
//0번 스테이징 버퍼가 아우풋 스테이징 버퍼와 같음
|
||||
//디폴트-> 스테이징 버퍼는 복사가 가능함 (다이나믹은 cpu 기반이라 복사 안됨)
|
||||
//0번 스테이징 버퍼가 아우풋 스테이징 버퍼와 같음
|
||||
|
||||
vector<D3D11_MAPPED_SUBRESOURCE> StagingSubResources = {};
|
||||
|
||||
@@ -78,7 +78,7 @@ vector<D3D11_MAPPED_SUBRESOURCE> CComputeShader::Dispatch(_uint iSRVIndex, _uint
|
||||
{
|
||||
m_pContext->CopyResource(m_pOutputStagingBuffer[i], m_pOutputBuffer[i]);
|
||||
|
||||
//스테이징 버퍼를 열어서 카피함
|
||||
//스테이징 버퍼를 열어서 카피함
|
||||
D3D11_MAPPED_SUBRESOURCE StagingSubResource = {};
|
||||
|
||||
if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, D3D11_MAP_READ, 0, &StagingSubResource)))
|
||||
@@ -99,9 +99,9 @@ vector<D3D11_MAPPED_SUBRESOURCE> CComputeShader::Dispatch(_uint iSRVIndex, _uint
|
||||
|
||||
void CComputeShader::Bind_SRV(_uint iIndex)
|
||||
{
|
||||
m_pContext->CSSetShaderResources(iIndex, // 시작슬롯 번호
|
||||
m_iNumInputBuffer, // 버퍼 개수
|
||||
&m_pInputSRV[0]); // 버퍼 시작 주소
|
||||
m_pContext->CSSetShaderResources(iIndex, // 시작슬롯 번호
|
||||
m_iNumInputBuffer, // 버퍼 개수
|
||||
&m_pInputSRV[0]); // 버퍼 시작 주소
|
||||
}
|
||||
|
||||
void CComputeShader::Bind_UAV(_uint iIndex)
|
||||
@@ -111,15 +111,15 @@ void CComputeShader::Bind_UAV(_uint iIndex)
|
||||
|
||||
void CComputeShader::Bind_OutPut_SRV(_uint iIndex, _uint iBufferIndex)
|
||||
{
|
||||
m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호
|
||||
1, // 버퍼 개수
|
||||
&m_pOutputSRV[iBufferIndex]); // 버퍼 시작 주소
|
||||
m_pContext->PSSetShaderResources(iIndex, // 시작슬롯 번호
|
||||
1, // 버퍼 개수
|
||||
&m_pOutputSRV[iBufferIndex]); // 버퍼 시작 주소
|
||||
|
||||
}
|
||||
|
||||
void CComputeShader::Reset()
|
||||
{
|
||||
//다음 랜더링 패스에 연관되지 않도록 초기화
|
||||
//다음 랜더링 패스에 연관되지 않도록 초기화
|
||||
|
||||
vector<ID3D11ShaderResourceView*> pResetSRVs = {};
|
||||
vector<ID3D11UnorderedAccessView*> pResetUAVs = {};
|
||||
@@ -141,10 +141,10 @@ void CComputeShader::Reset()
|
||||
|
||||
HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride[], _uint iOuputStructStride[])
|
||||
{
|
||||
//인 아웃풋 버퍼
|
||||
//인 아웃풋 버퍼
|
||||
|
||||
|
||||
for (_uint i = 0; i < m_iNumInputBuffer; i++) // 인풋 버퍼를 여러개 사용할 수 있도록 만든다
|
||||
for (_uint i = 0; i < m_iNumInputBuffer; i++) // 인풋 버퍼를 여러개 사용할 수 있도록 만든다
|
||||
{
|
||||
D3D11_BUFFER_DESC InputBufferdesc = {};
|
||||
|
||||
@@ -162,9 +162,9 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride
|
||||
|
||||
m_pInputBuffer.push_back(pInputBuffer);
|
||||
|
||||
//스테이징 버퍼 이름
|
||||
//스테이징 버퍼 이름
|
||||
D3D11_BUFFER_DESC StagingBufferDesc = {};
|
||||
StagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼
|
||||
StagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼
|
||||
StagingBufferDesc.ByteWidth = iInputStructStride[i] * iNumElement;
|
||||
StagingBufferDesc.StructureByteStride = iInputStructStride[i];
|
||||
StagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
|
||||
@@ -181,14 +181,14 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride
|
||||
|
||||
for (_uint i = 0; i < m_iNumOutputBuffer; i++)
|
||||
{
|
||||
// 아웃풋 버퍼
|
||||
// 아웃풋 버퍼
|
||||
|
||||
D3D11_BUFFER_DESC Bufferdesc = {};
|
||||
Bufferdesc.ByteWidth = iOuputStructStride[i] * iNumElement;
|
||||
Bufferdesc.StructureByteStride = iOuputStructStride[i];
|
||||
Bufferdesc.Usage = D3D11_USAGE_DEFAULT; // 인 아웃풋 버퍼는 디폴트로 설정해야함
|
||||
Bufferdesc.CPUAccessFlags = 0; // 디폴트 버퍼는 CPU에서 Read Write가 불가능하며
|
||||
//오직 Update_SubResource를 통해서만 갱신이 가능하다.
|
||||
Bufferdesc.Usage = D3D11_USAGE_DEFAULT; // 인 아웃풋 버퍼는 디폴트로 설정해야함
|
||||
Bufferdesc.CPUAccessFlags = 0; // 디폴트 버퍼는 CPU에서 Read Write가 불가능하며
|
||||
//오직 Update_SubResource를 통해서만 갱신이 가능하다.
|
||||
|
||||
Bufferdesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS;
|
||||
Bufferdesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
|
||||
@@ -201,9 +201,9 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride
|
||||
|
||||
m_pOutputBuffer.push_back(pOutputBuffer);
|
||||
|
||||
//아웃풋 스테이징 버퍼
|
||||
//아웃풋 스테이징 버퍼
|
||||
D3D11_BUFFER_DESC OutPutStagingBufferDesc = {};
|
||||
OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼
|
||||
OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼
|
||||
OutPutStagingBufferDesc.ByteWidth = iOuputStructStride[i] * iNumElement;
|
||||
OutPutStagingBufferDesc.StructureByteStride = iOuputStructStride[i];
|
||||
OutPutStagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
|
||||
@@ -222,7 +222,7 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride
|
||||
HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuffer)
|
||||
{
|
||||
// SRV
|
||||
for (_uint i = 0; i < iNumInputBuffer; i++) // 인풋 버퍼를 여러개 사용할 수 있도록 만든다
|
||||
for (_uint i = 0; i < iNumInputBuffer; i++) // 인풋 버퍼를 여러개 사용할 수 있도록 만든다
|
||||
{
|
||||
ID3D11ShaderResourceView* pSrv = {};
|
||||
|
||||
@@ -261,7 +261,7 @@ HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuf
|
||||
//SRV
|
||||
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
||||
srvDesc.Format = DXGI_FORMAT_UNKNOWN; // StructuredBuffer는 UNKNOWN
|
||||
srvDesc.Format = DXGI_FORMAT_UNKNOWN; // StructuredBuffer는 UNKNOWN
|
||||
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
|
||||
srvDesc.Buffer.NumElements = iNumElement;
|
||||
srvDesc.Buffer.FirstElement = 0;
|
||||
@@ -283,7 +283,7 @@ HRESULT CComputeShader::CreateComputeShader(const _tchar* pShaderFilePath, const
|
||||
{
|
||||
ID3DBlob* pCSBlob = nullptr;
|
||||
|
||||
// Debug 모드와 release 모드의 플레그를 다르게 줘야함
|
||||
// Debug 모드와 release 모드의 플레그를 다르게 줘야함
|
||||
UINT HLSLFlags = {};
|
||||
#ifdef _DEBUG
|
||||
HLSLFlags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
|
||||
@@ -303,10 +303,10 @@ HRESULT CComputeShader::CreateComputeShader(const _tchar* pShaderFilePath, const
|
||||
|
||||
|
||||
if (FAILED(m_pDevice->CreateComputeShader(
|
||||
pCSBlob->GetBufferPointer(), // 컴파일된 쉐이더 코드
|
||||
pCSBlob->GetBufferSize(), // 코드 길이
|
||||
nullptr, // 클래스 인스턴스 (없음)
|
||||
&m_pComputeShader // 컴퓨트 쉐이더 객체
|
||||
pCSBlob->GetBufferPointer(), // 컴파일된 쉐이더 코드
|
||||
pCSBlob->GetBufferSize(), // 코드 길이
|
||||
nullptr, // 클래스 인스턴스 (없음)
|
||||
&m_pComputeShader // 컴퓨트 쉐이더 객체
|
||||
)))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -323,7 +323,7 @@ CComputeShader* CComputeShader::Create(ID3D11Device* pDevice, ID3D11DeviceContex
|
||||
if (FAILED(pInstance->Initialize(pShaderFilePath, pStartFunctionName, iNumElement, iNumInputBuffer, iNumOutputBuffer, iOutputStructStride, iInputStructStride)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CComputeShader Prototype");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -335,22 +335,22 @@ void CComputeShader::Free()
|
||||
|
||||
for (_uint i = 0; i < m_iNumInputBuffer; i++)
|
||||
{
|
||||
Safe_Release(m_pInputSRV[i]);
|
||||
Safe_Release(m_pInputBuffer[i]);
|
||||
Safe_Release(m_pInputStagingBuffer[i]);
|
||||
SAFE_RELEASE(m_pInputSRV[i]);
|
||||
SAFE_RELEASE(m_pInputBuffer[i]);
|
||||
SAFE_RELEASE(m_pInputStagingBuffer[i]);
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_iNumOutputBuffer; i++)
|
||||
{
|
||||
Safe_Release(m_pOutputUAV[i]);
|
||||
Safe_Release(m_pOutputBuffer[i]);
|
||||
Safe_Release(m_pOutputSRV[i]);
|
||||
Safe_Release(m_pOutputStagingBuffer[i]);
|
||||
SAFE_RELEASE(m_pOutputUAV[i]);
|
||||
SAFE_RELEASE(m_pOutputBuffer[i]);
|
||||
SAFE_RELEASE(m_pOutputSRV[i]);
|
||||
SAFE_RELEASE(m_pOutputStagingBuffer[i]);
|
||||
}
|
||||
|
||||
|
||||
Safe_Release(m_pComputeShader);
|
||||
Safe_Release(m_pDevice);
|
||||
Safe_Release(m_pContext);
|
||||
Safe_Release(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pComputeShader);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//--------------------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DebugDraw.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "ElementObject.h"
|
||||
|
||||
CElementObject::CElementObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
|
||||
@@ -571,7 +571,7 @@ SaveModel* CGameInstance::Load_SaveModel(const _char* filePath)
|
||||
}
|
||||
|
||||
#pragma region PhysX_Manager
|
||||
PSX::PxMaterial* CGameInstance::Get_Material(_float3* vMatInfo)
|
||||
PSX::PxMaterial* CGameInstance::Create_Material(_float3* vMatInfo)
|
||||
{
|
||||
return m_pPhysX_Manager->Create_Material(vMatInfo);
|
||||
}
|
||||
@@ -581,11 +581,11 @@ void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTr
|
||||
return m_pPhysX_Manager->RegistTriMesh(pName, pPxTriMesh);
|
||||
}
|
||||
|
||||
const PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidDynamic* CGameInstance::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_DynamicActor(RigidBody);
|
||||
}
|
||||
const PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody& RigidBody)
|
||||
{
|
||||
return m_pPhysX_Manager->Add_StaticActor(RigidBody);
|
||||
}
|
||||
@@ -605,6 +605,14 @@ void CGameInstance::ReleaseController(_uint iControllerIndex)
|
||||
{
|
||||
m_pPhysX_Manager->ReleaseController(iControllerIndex);
|
||||
}
|
||||
void CGameInstance::Attach_Actor(CRigidBody& RigidBody, PSX::PxActor& Actor)
|
||||
{
|
||||
m_pPhysX_Manager->Attach_Actor(RigidBody, Actor);
|
||||
}
|
||||
void CGameInstance::Detach_Actor(CRigidBody& RigidBody, PSX::PxActor*& pActor)
|
||||
{
|
||||
m_pPhysX_Manager->Detach_Actor(RigidBody, pActor);
|
||||
}
|
||||
HRESULT CGameInstance::ConvertToTriMeshes(vector<class CMesh*>& Meshes, vector<class PSX::PxTriangleMesh*>& pxTriMeshes, _fmatrix WorldMatrix)
|
||||
{
|
||||
return m_pPhysX_Manager->ConvertToTriMeshes(Meshes, pxTriMeshes, WorldMatrix);
|
||||
@@ -726,7 +734,6 @@ void CGameInstance::Release_Engine()
|
||||
{
|
||||
DestroyInstance();
|
||||
|
||||
SAFE_RELEASE(m_pPhysX_Manager);
|
||||
SAFE_RELEASE(m_pPicking);
|
||||
SAFE_RELEASE(m_pCollider_Manager);
|
||||
SAFE_RELEASE(m_pShadow);
|
||||
@@ -738,9 +745,10 @@ void CGameInstance::Release_Engine()
|
||||
SAFE_RELEASE(m_pTimer_Manager);
|
||||
SAFE_RELEASE(m_pRenderer);
|
||||
SAFE_RELEASE(m_pObject_Manager);
|
||||
SAFE_RELEASE(m_pPhysX_Manager);
|
||||
SAFE_RELEASE(m_pLevel_Manager);
|
||||
SAFE_RELEASE(m_pPrototype_Manager);
|
||||
SAFE_RELEASE(m_pLight_Manager); // Light Manager는 m_pObject_Manager 보다 빨리 불려야함
|
||||
SAFE_RELEASE(m_pLight_Manager); // Light Manager�� m_pObject_Manager ���� ���� �ҷ�����
|
||||
SAFE_RELEASE(m_pGraphic_Device);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Transform.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Graphic_Device.h"
|
||||
|
||||
CGraphic_Device::CGraphic_Device()
|
||||
@@ -95,32 +95,32 @@ HRESULT CGraphic_Device::Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY)
|
||||
IDXGIFactory* pFactory = nullptr;
|
||||
pAdapter->GetParent(__uuidof(IDXGIFactory), (void**)&pFactory);
|
||||
|
||||
/* 스왑체인을 생성한다. = 텍스쳐를 생성하는 행위 + 스왑하는 형태 */
|
||||
/* 스왑체인을 생성한다. = 텍스쳐를 생성하는 행위 + 스왑하는 형태 */
|
||||
DXGI_SWAP_CHAIN_DESC SwapChain;
|
||||
ZeroMemory(&SwapChain, sizeof(DXGI_SWAP_CHAIN_DESC));
|
||||
|
||||
/* 백버퍼 == 텍스쳐 */
|
||||
/*텍스처(백버퍼 == ID3D11Texture2D)를 생성하는 행위*/
|
||||
SwapChain.BufferDesc.Width = iWinCX; /* 가로 픽셀 수 */
|
||||
SwapChain.BufferDesc.Height = iWinCY; /* 세로 픽셀 수 */
|
||||
/* 백버퍼 == 텍스쳐 */
|
||||
/*텍스처(백버퍼 == ID3D11Texture2D)를 생성하는 행위*/
|
||||
SwapChain.BufferDesc.Width = iWinCX; /* 가로 픽셀 수 */
|
||||
SwapChain.BufferDesc.Height = iWinCY; /* 세로 픽셀 수 */
|
||||
|
||||
/* float4(1.f, 1.f, 1.f, 1.f) */
|
||||
/* float4(1.f, 0.f, 0.f, 1.f) */
|
||||
SwapChain.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; /* 만든 픽셀하나의 데이터 정보 : 32BIT픽셀생성하되 부호가 없는 정규화된 수를 저장할께 */
|
||||
SwapChain.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; /* 만든 픽셀하나의 데이터 정보 : 32BIT픽셀생성하되 부호가 없는 정규화된 수를 저장할께 */
|
||||
SwapChain.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
|
||||
SwapChain.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
|
||||
|
||||
/* 스케치북에 사과를 그릴꺼야. */
|
||||
/* RENDER_TARGET : 그림을 당하는 대상. 스케치북 */
|
||||
/* 스케치북에 사과를 그릴꺼야. */
|
||||
/* RENDER_TARGET : 그림을 당하는 대상. 스케치북 */
|
||||
SwapChain.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
|
||||
SwapChain.BufferCount = 1;
|
||||
|
||||
/*스왑하는 형태 : 모니터 주사율에 따라 조절해도 됨. */
|
||||
/*스왑하는 형태 : 모니터 주사율에 따라 조절해도 됨. */
|
||||
SwapChain.BufferDesc.RefreshRate.Numerator = 60;
|
||||
SwapChain.BufferDesc.RefreshRate.Denominator = 1;
|
||||
|
||||
/* 멀티샘플링 : 안티얼라이징 (계단현상방지) */
|
||||
/* 나중에 후처리 렌더링 : 멀티샘플링 지원(x) */
|
||||
/* 멀티샘플링 : 안티얼라이징 (계단현상방지) */
|
||||
/* 나중에 후처리 렌더링 : 멀티샘플링 지원(x) */
|
||||
SwapChain.SampleDesc.Quality = 0;
|
||||
SwapChain.SampleDesc.Count = 1;
|
||||
|
||||
@@ -128,7 +128,7 @@ HRESULT CGraphic_Device::Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY)
|
||||
SwapChain.Windowed = static_cast<BOOL>(true);
|
||||
SwapChain.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
|
||||
|
||||
/* 백버퍼라는 텍스처(ID3D11Texture2D)를 생성했다. */
|
||||
/* 백버퍼라는 텍스처(ID3D11Texture2D)를 생성했다. */
|
||||
if (FAILED(pFactory->CreateSwapChain(m_pDevice, &SwapChain, &m_pSwapChain)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
|
||||
#include "Instance_Model.h"
|
||||
#include "Mesh.h"
|
||||
@@ -23,7 +23,7 @@ CInstance_Model::CInstance_Model(const CInstance_Model& rhs)
|
||||
SAFE_ADDREF(pMesh);
|
||||
}
|
||||
|
||||
Safe_AddRef(m_pVBInstance);
|
||||
SAFE_ADDREF(m_pVBInstance);
|
||||
}
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
@@ -88,50 +88,65 @@ HRESULT CInstance_Model::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fma
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CInstance_Model::Save_InstanceModel(HANDLE hFile)
|
||||
{
|
||||
DWORD dwByte = {};
|
||||
|
||||
if (!WriteFile(hFile, &m_InstanceDesc, sizeof(INSTANCE_DESC), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
HRESULT CInstance_Model::Load_InstanceModel(HANDLE hFile)
|
||||
{
|
||||
DWORD dwByte = {};
|
||||
|
||||
if (!ReadFile(hFile, &m_InstanceDesc, sizeof(INSTANCE_DESC), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
Change_NumInstance();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstance_Model::Change_NumInstance()
|
||||
{
|
||||
Safe_Release(m_pVBInstance);
|
||||
Safe_Release(m_pComputeShader);
|
||||
Safe_Release(m_pConstantBuffer);
|
||||
Safe_Release(m_pParticleValueBuffer);
|
||||
SAFE_RELEASE(m_pVBInstance);
|
||||
SAFE_RELEASE(m_pComputeShader);
|
||||
SAFE_RELEASE(m_pConstantBuffer);
|
||||
SAFE_RELEASE(m_pParticleValueBuffer);
|
||||
|
||||
//모든 버퍼를 지우고 재 생성 해야함
|
||||
//모든 버퍼를 지우고 재 생성 해야함
|
||||
|
||||
if (FAILED(Create_Instance_Buffer(&m_InstanceDesc)))
|
||||
if (FAILED(Create_Instance_Buffer()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Create_SubResource_Buffer()))
|
||||
return E_FAIL;
|
||||
|
||||
//시작 시에 인스턴트 버퍼를 구성 해줌
|
||||
|
||||
//시작 시에 인스턴트 버퍼를 구성 해줌
|
||||
Instane_Buffer_ReStruct();
|
||||
|
||||
_uint CS_InputStrides[] = {
|
||||
sizeof(VTX_INSTANCE_PARTICLE),
|
||||
sizeof(CS_PARTICLE_VALUE_DESC),
|
||||
};
|
||||
|
||||
_uint CS_OutputStrides[] = {
|
||||
sizeof(VTX_INSTANCE_PARTICLE),
|
||||
sizeof(CS_PARTICLE_VALUE_DESC),
|
||||
};
|
||||
|
||||
m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext,
|
||||
L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, 2, CS_OutputStrides, CS_InputStrides);
|
||||
|
||||
if (m_pComputeShader == nullptr)
|
||||
if (FAILED(Create_CS()))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstance_Model::Create_Instance_Buffer(const INSTANCE_DESC* pDesc)
|
||||
HRESULT CInstance_Model::Create_Instance_Buffer()
|
||||
{
|
||||
if (pDesc != nullptr)
|
||||
m_InstanceDesc = *pDesc;
|
||||
|
||||
|
||||
m_iNumInstance = m_InstanceDesc.iNumInstance;
|
||||
|
||||
@@ -158,7 +173,7 @@ HRESULT CInstance_Model::Create_Instance_Buffer(const INSTANCE_DESC* pDesc)
|
||||
HRESULT CInstance_Model::Create_SubResource_Buffer()
|
||||
{
|
||||
|
||||
// 벨류 버퍼 생성하기
|
||||
// 벨류 버퍼 생성하기
|
||||
D3D11_BUFFER_DESC Particle_Buffer_Desc = {};
|
||||
Particle_Buffer_Desc.ByteWidth = sizeof(CS_PARTICLE_VALUE_DESC) * m_iNumInstance;
|
||||
Particle_Buffer_Desc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
@@ -175,7 +190,7 @@ HRESULT CInstance_Model::Create_SubResource_Buffer()
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
//컨스턴트 버퍼 생성하기
|
||||
//컨스턴트 버퍼 생성하기
|
||||
|
||||
D3D11_BUFFER_DESC cbDesc = {};
|
||||
cbDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
@@ -191,26 +206,11 @@ HRESULT CInstance_Model::Create_SubResource_Buffer()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CInstance_Model::Initialize(void* pArg)
|
||||
HRESULT CInstance_Model::Create_CS()
|
||||
{
|
||||
|
||||
INSTANCE_DESC* pInstanceDesc = static_cast<INSTANCE_DESC*>(pArg);
|
||||
|
||||
|
||||
|
||||
if (FAILED(Create_Instance_Buffer(pInstanceDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Create_SubResource_Buffer()))
|
||||
return E_FAIL;
|
||||
|
||||
//시작 시에 인스턴트 버퍼를 구성 해줌
|
||||
Instane_Buffer_ReStruct();
|
||||
|
||||
_uint CS_InputStrides[] = {
|
||||
sizeof(VTX_INSTANCE_PARTICLE),
|
||||
sizeof(CS_PARTICLE_VALUE_DESC),
|
||||
sizeof(VTX_INSTANCE_PARTICLE),
|
||||
sizeof(CS_PARTICLE_VALUE_DESC),
|
||||
};
|
||||
|
||||
_uint CS_OutputStrides[] = {
|
||||
@@ -227,6 +227,32 @@ HRESULT CInstance_Model::Initialize(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CInstance_Model::Initialize(void* pArg)
|
||||
{
|
||||
|
||||
INSTANCE_DESC* pInstanceDesc = static_cast<INSTANCE_DESC*>(pArg);
|
||||
|
||||
if (pInstanceDesc != nullptr)
|
||||
m_InstanceDesc = *pInstanceDesc;
|
||||
else
|
||||
return S_OK;
|
||||
|
||||
if (FAILED(Create_Instance_Buffer()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Create_SubResource_Buffer()))
|
||||
return E_FAIL;
|
||||
|
||||
//시작 시에 인스턴트 버퍼를 구성 해줌
|
||||
Instane_Buffer_ReStruct();
|
||||
|
||||
if(FAILED(Create_CS()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CInstance_Model::Drop(_float fTimeDelta)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {};
|
||||
@@ -262,7 +288,7 @@ void CInstance_Model::Drop(_float fTimeDelta)
|
||||
if (SUCCEEDED(m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_DISCARD, 0, &VBInstanceResource)))
|
||||
{
|
||||
|
||||
memcpy(VBInstanceResource.pData, OutSubResources[0].pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다.
|
||||
memcpy(VBInstanceResource.pData, OutSubResources[0].pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다.
|
||||
|
||||
m_pContext->Unmap(m_pVBInstance, 0);
|
||||
}
|
||||
@@ -273,7 +299,7 @@ void CInstance_Model::Drop(_float fTimeDelta)
|
||||
{
|
||||
CS_PARTICLE_VALUE_DESC* pValueDesc = static_cast<CS_PARTICLE_VALUE_DESC*>(OutSubResources[1].pData);
|
||||
|
||||
memcpy(ParticleValueResource.pData, OutSubResources[1].pData, sizeof(CS_PARTICLE_VALUE_DESC) * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다.
|
||||
memcpy(ParticleValueResource.pData, OutSubResources[1].pData, sizeof(CS_PARTICLE_VALUE_DESC) * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다.
|
||||
|
||||
m_pContext->Unmap(m_pParticleValueBuffer, 0);
|
||||
}
|
||||
@@ -312,7 +338,7 @@ void CInstance_Model::Instane_Buffer_ReStruct()
|
||||
for (size_t i = 0; i < m_iNumInstance; i++)
|
||||
{
|
||||
|
||||
//스케일 설정
|
||||
//스케일 설정
|
||||
_float3 vScale = _float3(
|
||||
m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.x, m_InstanceDesc.vSizeMax.x),
|
||||
m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.y, m_InstanceDesc.vSizeMax.y),
|
||||
@@ -321,7 +347,7 @@ void CInstance_Model::Instane_Buffer_ReStruct()
|
||||
|
||||
_matrix ScaleMatrix = XMMatrixScaling(vScale.x, vScale.y, vScale.z);
|
||||
|
||||
//로테이션 설정
|
||||
//로테이션 설정
|
||||
_float3 vRoataion = _float3(
|
||||
m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.x, m_InstanceDesc.vRotationAngleMax.x),
|
||||
m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.y, m_InstanceDesc.vRotationAngleMax.y),
|
||||
@@ -335,7 +361,7 @@ void CInstance_Model::Instane_Buffer_ReStruct()
|
||||
);
|
||||
|
||||
|
||||
//위치 설정
|
||||
//위치 설정
|
||||
_float4x4 SRMatrix = {};
|
||||
|
||||
XMStoreFloat4x4(&SRMatrix, ScaleMatrix * RotationMatrix);
|
||||
@@ -351,7 +377,7 @@ void CInstance_Model::Instane_Buffer_ReStruct()
|
||||
m_pGameInstance->Random_Float(m_InstanceDesc.vCenter.z - m_InstanceDesc.vRange.z * 0.5f, m_InstanceDesc.vCenter.z + m_InstanceDesc.vRange.z * 0.5f),
|
||||
1.f);
|
||||
|
||||
//라이프 타임 설정
|
||||
//라이프 타임 설정
|
||||
pVertices[i].vLifeTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vLifeTime.x, m_InstanceDesc.vLifeTime.y));
|
||||
|
||||
pParticleValues[i].vAniTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vAniTime.x, m_InstanceDesc.vAniTime.y));
|
||||
@@ -423,17 +449,17 @@ void CInstance_Model::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pVBInstance);
|
||||
SAFE_RELEASE(m_pVBInstance);
|
||||
|
||||
for (auto& pMesh : m_Meshes)
|
||||
Safe_Release(pMesh);
|
||||
SAFE_RELEASE(pMesh);
|
||||
|
||||
for (auto& pBone : m_Bones)
|
||||
Safe_Release(pBone);
|
||||
SAFE_RELEASE(pBone);
|
||||
|
||||
Safe_Release(m_pComputeShader);
|
||||
Safe_Release(m_pConstantBuffer);
|
||||
Safe_Release(m_pParticleValueBuffer);
|
||||
SAFE_RELEASE(m_pComputeShader);
|
||||
SAFE_RELEASE(m_pConstantBuffer);
|
||||
SAFE_RELEASE(m_pParticleValueBuffer);
|
||||
}
|
||||
|
||||
void CInstance_Model::Describe_Entity()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Light.h"
|
||||
#include "Shader.h"
|
||||
#include "VIBuffer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
|
||||
CLight::CLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -72,6 +73,9 @@ HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const
|
||||
if (FAILED(pShader->Bind_RawValue("g_vLightPos", m_LightDesc.pPosition, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pShader->Bind_RawValue("g_vLightPosOffset", &m_LightDesc.vPosOffset, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pShader->Bind_RawValue("g_fLightRange", &m_LightDesc.fRange, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -84,7 +88,10 @@ HRESULT CLight::Render(CShader* pShader, CVIBuffer* pVIBuffer) const
|
||||
iPassIndex = ENUM_CLASS(SHADER_PASS_DEFERRED::SPOT);
|
||||
}
|
||||
else {
|
||||
if (FAILED(pShader->Bind_RawValue("g_vLightPos", m_LightDesc.pDirection, sizeof(_float4)))) {
|
||||
if (FAILED(pShader->Bind_RawValue("g_vLightPos", m_LightDesc.pPosition, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pShader->Bind_RawValue("g_vLightPosOffset", &m_LightDesc.vPosOffset, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(pShader->Bind_RawValue("g_fLightRange", &m_LightDesc.fRange, sizeof(_float)))) {
|
||||
@@ -147,7 +154,7 @@ void CLight::Free()
|
||||
|
||||
void CLight::Describe_Entity()
|
||||
{
|
||||
if (ImGui::TreeNode("LIGHT"))
|
||||
if (ImGui::TreeNode("LIGHT_INFO"))
|
||||
{
|
||||
ImGui::Separator(); ImGui::Spacing();
|
||||
|
||||
@@ -160,12 +167,23 @@ void CLight::Describe_Entity()
|
||||
m_LightDesc.eType = static_cast<LIGHT>(iCurrentItem);
|
||||
}
|
||||
|
||||
ImGui::DragFloat4("Diffuse", reinterpret_cast<float*>(&m_LightDesc.vDiffuse));
|
||||
ImGui::DragFloat4("Ambient", reinterpret_cast<float*>(&m_LightDesc.vAmbient));
|
||||
ImGui::DragFloat4("Specular", reinterpret_cast<float*>(&m_LightDesc.vSpecular));
|
||||
GUI::DragFloat4("Diffuse", reinterpret_cast<float*>(&m_LightDesc.vDiffuse) , 0.01f , 0.f ,1.f);
|
||||
GUI::DragFloat4("Ambient", reinterpret_cast<float*>(&m_LightDesc.vAmbient), 0.01f, 0.f, 1.f);
|
||||
GUI::DragFloat4("Specular", reinterpret_cast<float*>(&m_LightDesc.vSpecular), 0.01f, 0.f, 1.f);
|
||||
GUI::DragFloat("Range", &m_LightDesc.fRange, 1.f, 0.f);
|
||||
GUI::DragFloat2("SpotAngle", reinterpret_cast<float*>(&m_LightDesc.vSpotAngles));
|
||||
|
||||
ImGui::TreePop();
|
||||
GUI::Spacing();
|
||||
GUI::Spacing();
|
||||
|
||||
GUI::DragFloat3("PosOffest", reinterpret_cast<float*>(&m_LightDesc.vPosOffset));
|
||||
|
||||
GUI::Spacing();
|
||||
|
||||
m_pOwner->Get_Component<CTransform>()->Describe_Entity();
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
GUI::Separator();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Material.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Shader.h"
|
||||
@@ -60,9 +60,9 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAI
|
||||
strcat_s(szTextureFilePath, szTextureFileName);
|
||||
strcat_s(szTextureFilePath, ".dds");
|
||||
|
||||
hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // 일단 dds로 시도하고
|
||||
hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // 일단 dds로 시도하고
|
||||
if (FAILED(hr)) {
|
||||
memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 원래 확장자로 다시 시도
|
||||
memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 원래 확장자로 다시 시도
|
||||
strcat_s(szTextureFilePath, szTextureFileName);
|
||||
strcat_s(szTextureFilePath, szEXT);
|
||||
|
||||
@@ -327,13 +327,13 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
|
||||
{
|
||||
size_t startPos = mapRePos + strSearchString.length();
|
||||
|
||||
// 'MapRe' 뒤에 오는 경로 건너뛰기
|
||||
// 'MapRe' 뒤에 오는 경로 건너뛰기
|
||||
if (startPos < strTexturePath.length() &&
|
||||
(strTexturePath[startPos] == '\\' || strTexturePath[startPos] == '/')) {
|
||||
startPos++;
|
||||
}
|
||||
|
||||
// 'MapRe' 이후의 나머지 경로를 추출
|
||||
// 'MapRe' 이후의 나머지 경로를 추출
|
||||
strResultPath = strPrefix + strTexturePath.substr(startPos);
|
||||
}
|
||||
else
|
||||
@@ -350,19 +350,19 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
|
||||
}
|
||||
HRESULT CMaterial::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
// 실제 값을 저장하지 않고 파일이름.확장자명의 문자열을 저장해서 수정하기 편하게 만들기
|
||||
// 대신 리소스를 공유해야함
|
||||
// 텍스쳐를 저장하지 않고
|
||||
// 텍스쳐 경로만 ( "이름.확장자" ) 만 저장함
|
||||
// 실제 값을 저장하지 않고 파일이름.확장자명의 문자열을 저장해서 수정하기 편하게 만들기
|
||||
// 대신 리소스를 공유해야함
|
||||
// 텍스쳐를 저장하지 않고
|
||||
// 텍스쳐 경로만 ( "이름.확장자" ) 만 저장함
|
||||
for (int i = 0; i < AI_TEXTURE_TYPE_MAX; ++i) {
|
||||
_uint iNumSrv = (_uint)m_strPath[i].size();
|
||||
WriteFile(hFile, &i, sizeof(_uint), &dwByte, nullptr); // 종류 저장
|
||||
WriteFile(hFile, &iNumSrv, sizeof(_uint), &dwByte, nullptr); // 종류의 갯수 저장
|
||||
WriteFile(hFile, &i, sizeof(_uint), &dwByte, nullptr); // 종류 저장
|
||||
WriteFile(hFile, &iNumSrv, sizeof(_uint), &dwByte, nullptr); // 종류의 갯수 저장
|
||||
for (_uint j = 0; j < iNumSrv; ++j) {
|
||||
m_strPath[i][j].shrink_to_fit();
|
||||
_uint strLength = (_uint)(sizeof(_char) * m_strPath[i][j].length());
|
||||
WriteFile(hFile, &strLength, sizeof(_uint), &dwByte, nullptr); // 사이즈 저장
|
||||
WriteFile(hFile, m_strPath[i][j].data(), strLength, &dwByte, nullptr); // 실제 값 저장
|
||||
WriteFile(hFile, &strLength, sizeof(_uint), &dwByte, nullptr); // 사이즈 저장
|
||||
WriteFile(hFile, m_strPath[i][j].data(), strLength, &dwByte, nullptr); // 실제 값 저장
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
@@ -452,7 +452,7 @@ CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex
|
||||
if (FAILED(pInstance->Initialize(pModelFilePath, _SaveMaterial)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMaterial");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Mesh.h"
|
||||
#include "Model.h"
|
||||
#include "Bone.h"
|
||||
@@ -154,7 +154,7 @@ HRESULT CMesh::Render_Instance(_uint iNumInstance)
|
||||
|
||||
HRESULT CMesh::Initialize_Prototype(HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
{ // 멤버변수
|
||||
{ // 멤버변수
|
||||
if (!ReadFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL
|
||||
|
||||
HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
{
|
||||
{ // 멤버변수
|
||||
{ // 멤버변수
|
||||
WriteFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr);
|
||||
WriteFile(hFile, &m_iNumVertexBuffers, sizeof(_uint), &dwByte, nullptr);
|
||||
WriteFile(hFile, &m_iNumVertices, sizeof(_uint), &dwByte, nullptr);
|
||||
@@ -556,7 +556,7 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
}
|
||||
{ // Vertex Buffer
|
||||
D3D11_BUFFER_DESC VBDesc{};
|
||||
m_pVB->GetDesc(&VBDesc); // 버퍼 디스크립션 저장
|
||||
m_pVB->GetDesc(&VBDesc); // 버퍼 디스크립션 저장
|
||||
WriteFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr);
|
||||
|
||||
D3D11_BUFFER_DESC StagingDesc{};
|
||||
@@ -570,7 +570,7 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
|
||||
if (FAILED(m_pDevice->CreateBuffer(&StagingDesc, nullptr, &pStaging)) || nullptr == pStaging) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pContext->CopyResource(pStaging, m_pVB); // 버퍼 복사
|
||||
m_pContext->CopyResource(pStaging, m_pVB); // 버퍼 복사
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mapped{};
|
||||
m_pContext->Map(pStaging, 0, D3D11_MAP_READ, 0, &mapped);
|
||||
@@ -799,7 +799,7 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL
|
||||
if (FAILED(pInstance->Initialize_Prototype(eType, pModel, _SaveMesh, PreTransformMatrix)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMesh");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -1129,7 +1129,7 @@ CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MOD
|
||||
if (FAILED(pInstance->Initialize_Prototype(eType, pModelFilePath, PreTransformMatrix)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CModel");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
|
||||
@@ -5,19 +5,6 @@
|
||||
#include "RigidBody.h"
|
||||
#include "Mesh.h"
|
||||
|
||||
static PSX::PxTransform XMWorldToPx_NoScale(const _matrix& WorldMatrix)
|
||||
{
|
||||
_vector vPos, vRotq, vScale;
|
||||
XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix);
|
||||
|
||||
vRotq = XMQuaternionNormalize(vRotq);
|
||||
|
||||
PSX::PxTransform out;
|
||||
XMStoreFloat3((_float3*)&out.p, vPos);
|
||||
XMStoreFloat4((_float4*)&out.q, vRotq);
|
||||
return out;
|
||||
}
|
||||
|
||||
CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :
|
||||
m_pDevice(pDevice),
|
||||
m_pContext(pContext),
|
||||
@@ -28,15 +15,13 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidDynamic 씬의 동적 바디 인터페이스
|
||||
PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix);
|
||||
pActorDynamic->userData = &RigidBody;
|
||||
|
||||
PSX::PxShape* pShape = nullptr;
|
||||
PSX::PxGeometryHolder geoHolder = {};
|
||||
|
||||
@@ -78,21 +63,18 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod
|
||||
PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density());
|
||||
}
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, pActorDynamic);
|
||||
m_pScene->addActor(*pActorDynamic);
|
||||
Attach_Actor(RigidBody, *pActorDynamic);
|
||||
|
||||
return pActorDynamic;
|
||||
}
|
||||
|
||||
const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
{
|
||||
_matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix();
|
||||
PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix);
|
||||
|
||||
// PxRigidStatic 씬의 정적 바디 인터페이스
|
||||
PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix);
|
||||
pActor->userData = &RigidBody;
|
||||
|
||||
PSX::PxShape* pShape = { nullptr };
|
||||
PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey());
|
||||
PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr };
|
||||
@@ -136,8 +118,8 @@ const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody)
|
||||
pShape->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pShape->setRestOffset(0.f);
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, pActor);
|
||||
m_pScene->addActor(*pActor);
|
||||
|
||||
Attach_Actor(RigidBody, *pActor);
|
||||
|
||||
return pActor;
|
||||
}
|
||||
@@ -330,15 +312,18 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors()
|
||||
PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor);
|
||||
|
||||
for (PSX::PxU32 i = 0; i < iNumActiveActor; ++i) {
|
||||
PhsXUserData* pUserData = (PhsXUserData*)ppActiveActors[i]->userData;
|
||||
PSX::PxRigidDynamic* pActorDynamic = ppActiveActors[i]->is<PSX::PxRigidDynamic>();
|
||||
|
||||
if (nullptr != pActorDynamic) {
|
||||
if (nullptr == ppActiveActors[i]->userData) {
|
||||
continue;
|
||||
}
|
||||
CTransform* pTransform = ((CRigidBody*)ppActiveActors[i]->userData)->Get_TransformPtr();
|
||||
CTransform* pTransform = pUserData->pOwner->Get_Component<CTransform>();
|
||||
|
||||
|
||||
// PSX::PxTransform pPrevPxTransform = pUserData->m_BeforeMatrix;
|
||||
// XMMatrixDecompose(nullptr, (_vector*)&pPrevPxTransform.q, (_vector*)&pPrevPxTransform.p, XMLoadFloat4x4(&pUserData->m_BeforeMatrix));
|
||||
|
||||
PSX::PxTransform pPrevPxTransform;
|
||||
PSX::PxTransform pPxTransform = pActorDynamic->getGlobalPose();
|
||||
_float3 vOriginalScale = pTransform->Get_Scale();
|
||||
_matrix WorldMatrix = {};
|
||||
@@ -354,21 +339,21 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors()
|
||||
//}
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Update_Dynamic_AllActors()
|
||||
{
|
||||
for (pair<CRigidBody*, PSX::PxActor*>& pairActors : m_RigidBodys) {
|
||||
PSX::PxRigidDynamic* pActorDynamic = pairActors.second->is<PSX::PxRigidDynamic>();
|
||||
if (nullptr != pActorDynamic) {
|
||||
CTransform* pTransform = ((CRigidBody*)(pActorDynamic->userData))->Get_TransformPtr();
|
||||
|
||||
PSX::PxTransform pxTransform = pActorDynamic->getGlobalPose();
|
||||
_float3 vOriginalScale = pTransform->Get_Scale();
|
||||
_matrix WorldMatrix = {};
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMLoadFloat3((_float3*)&pxTransform.p));
|
||||
pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
//void CPhysX_Manager::Update_Dynamic_AllActors()
|
||||
//{
|
||||
// for (pair<CRigidBody*, PSX::PxActor*>& pairActors : m_RigidBodys) {
|
||||
// PSX::PxRigidDynamic* pActorDynamic = pairActors.second->is<PSX::PxRigidDynamic>();
|
||||
// if (nullptr != pActorDynamic) {
|
||||
// CTransform* pTransform = ((CRigidBody*)(pActorDynamic->userData))->Get_TransformPtr();
|
||||
//
|
||||
// PSX::PxTransform pxTransform = pActorDynamic->getGlobalPose();
|
||||
// _float3 vOriginalScale = pTransform->Get_Scale();
|
||||
// _matrix WorldMatrix = {};
|
||||
// WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMLoadFloat3((_float3*)&pxTransform.p));
|
||||
// pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
void CPhysX_Manager::ClearScene()
|
||||
{
|
||||
@@ -376,6 +361,32 @@ void CPhysX_Manager::ClearScene()
|
||||
pObject.second->release();
|
||||
} m_RigidBodys.clear();
|
||||
}
|
||||
void CPhysX_Manager::Attach_Actor(CRigidBody& RigidBody, PSX::PxActor& Actor)
|
||||
{
|
||||
if (m_pScene == nullptr){
|
||||
return;
|
||||
}
|
||||
|
||||
m_RigidBodys.emplace_back(&RigidBody, &Actor);
|
||||
m_pScene->addActor(Actor);
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Detach_Actor(CRigidBody& RigidBody, PSX::PxActor*& pActor)
|
||||
{
|
||||
if (m_pScene == nullptr){
|
||||
return;
|
||||
}
|
||||
|
||||
list<pair<CRigidBody*, PSX::PxActor*>>::iterator iter = m_RigidBodys.begin();
|
||||
for (; iter != m_RigidBodys.end(); ++iter){
|
||||
if ((*iter).second == pActor) {
|
||||
m_RigidBodys.erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_pScene->removeActor(*pActor);
|
||||
}
|
||||
|
||||
PSX::PxController* CPhysX_Manager::Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc)
|
||||
{
|
||||
@@ -433,7 +444,6 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
assert(false);
|
||||
}
|
||||
|
||||
|
||||
{ // 씬 세팅
|
||||
m_ToleranceScale.length = 1.f; // 1 meter
|
||||
m_ToleranceScale.speed = GRAVITY; //
|
||||
@@ -453,17 +463,42 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
sceneDesc.cpuDispatcher = m_pDispatcher;
|
||||
//sceneDesc.simulationEventCallback = ; // fetchResults 때 불림. 아래 필터랑, pair랑 같이 짝꿍임. 좀 더 공부해야 쓸 수 있을듯;;
|
||||
sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader; // 레이어 충돌, 오브젝트에 속성을 주고 복잡한 필터링 충돌 식
|
||||
sceneDesc.flags =
|
||||
PSX::PxSceneFlag::eENABLE_PCM // 기본 true, 현대적인 충돌시스템 적용
|
||||
| PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS // 현재 움직임이 있는 액터만 가져옴
|
||||
| PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS // 그중에 키네틱은 뺌
|
||||
| PSX::PxSceneFlag::eENABLE_CCD // CCD 기본플래그, 키면 비쌈. 단일오브젝트만 켤 수 있으니 선택적으로 고려
|
||||
| PSX::PxSceneFlag::eDISABLE_CCD_RESWEEP // CCD 옵션플래그, 정확도 낮추고 비용 아낌
|
||||
//| PSX::PxSceneFlag::eDISABLE_CONTACT_REPORT_BUFFER_RESIZE // 접촉 리포트버퍼 리사이즈 금지 -> 보통 끔
|
||||
//| PSX::PxSceneFlag::eDISABLE_CONTACT_CACHE // 접촉 캐시를 금지 -> 그냥 켜두자, 캐시 있는게 보통 더 낫다
|
||||
//| PSX::PxSceneFlag::eREQUIRE_RW_LOCK // 멀티스레딩 환경에서 혹시라도 락 걸고 접근하지 않아 발생할 일을 제거,
|
||||
//| PSX::PxSceneFlag::eENABLE_STABILIZATION // 물체가 얽힌 상황에서 불안정한걸 방지. 추가비용인듯
|
||||
//| PSX::PxSceneFlag::eENABLE_AVERAGE_POINT // 이해 못하겠음
|
||||
//| PSX::PxSceneFlag::eEnable_GPU_Dynamics // 피직스 그래픽가속 설정. 여기선 세팅 안돼서 비활성화ㅏ
|
||||
//| PSX::PxSceneFlag::eEnable_Direct_GPU_API // 직접 그래픽버퍼를 다루게끔 설정
|
||||
//| PSX::PxSceneFlag::eEnable_Enhanced_Determinism // 중간에 액터 추가해도 결과가 바뀌지 않는 결정론 수준 향상, 리플레이기능 ㅇㅇ
|
||||
//| PSX::PxSceneFlag::eENABLE_FRICTION_EVERY_ITERATION // 마찰 꼐산 추가
|
||||
//| PSX::PxSceneFlag::eENABLE_EXTERNAL_FORCES_EVERY_ITERATION_TGS // 중력 나눠서 여러번 적용
|
||||
//| PSX::PxSceneFlag::eENABLE_PCM // 기본 true
|
||||
//| PSX::PxSceneFlag::eENABLE_BODY_ACCELERATIONS // 선형 각가속도 값을 쿼리가능하도록 설정
|
||||
//| PSX::PxSceneFlag::eEnable_solver_residual_reporting // 고급 디버깅, 연구 용
|
||||
//| PSX::PxSceneFlag::eSOLVE_ARTICULATION_CONTACT_LAST 물리 관절 처리 시나리오 순서 변경
|
||||
;
|
||||
|
||||
sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader;
|
||||
|
||||
sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM | PSX::PxSceneFlag::eENABLE_CCD| PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS | PSX::PxSceneFlag::eEXCLUDE_KINEMATICS_FROM_ACTIVE_ACTORS;
|
||||
if (false == sceneDesc.isValid()) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pScene = m_pPhysics->createScene(sceneDesc);
|
||||
|
||||
// CCT
|
||||
m_pCCTManager = PxCreateControllerManager(*m_pScene);
|
||||
m_pCCTManager->setOverlapRecoveryModule(false);
|
||||
m_pCCTManager->setOverlapRecoveryModule(true); // 복구모듈은 하이트필드에는 적용되지 않음, 오직 스태틱만 대상
|
||||
m_pCCTManager->setPreciseSweeps(true); // 정밀 스윕
|
||||
m_pCCTManager->setPreventVerticalSlidingAgainstCeiling(false); // 천장타고 슬라이딩 허용 비허용
|
||||
}
|
||||
|
||||
// 디버그서버의 클라 세팅
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Picking.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
@@ -7,9 +7,9 @@ CPicking::CPicking(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
, m_pContext{ pContext }
|
||||
, m_pGameInstance{ CGameInstance::GetInstance() }
|
||||
{
|
||||
Safe_AddRef(m_pDevice);
|
||||
Safe_AddRef(m_pContext);
|
||||
Safe_AddRef(m_pGameInstance);
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
HRESULT CPicking::Initialize(HWND hWnd, _uint iSizeX, _uint iSizeY)
|
||||
@@ -90,7 +90,7 @@ CPicking* CPicking::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext,
|
||||
if (FAILED(pInstance->Initialize(hWnd, iSizeX, iSizeY)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CPicking");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -100,9 +100,9 @@ void CPicking::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pDevice);
|
||||
Safe_Release(m_pContext);
|
||||
Safe_Release(m_pTexture2D);
|
||||
Safe_Release(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
SAFE_RELEASE(m_pTexture2D);
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
Safe_Delete_Array(m_pPixels);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "RigidBody.h"
|
||||
#include "GameInstance.h"
|
||||
#include "GameObject.h"
|
||||
@@ -53,6 +53,25 @@ HRESULT CRigidBody::Render()
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
void CRigidBody::Set_Kinematic(_bool bKinematic)
|
||||
{
|
||||
static_cast<PSX::PxRigidDynamic*>(m_pRigidBody)->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, bKinematic);
|
||||
}
|
||||
|
||||
void CRigidBody::Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType)
|
||||
{
|
||||
PSX::PxVec3 vPxForce = {};
|
||||
XMStoreFloat3((_float3*)&vPxForce, vForce);
|
||||
static_cast<PSX::PxRigidDynamic*>(m_pRigidBody)->addForce(vPxForce, eType);
|
||||
}
|
||||
|
||||
void CRigidBody::Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType)
|
||||
{
|
||||
PSX::PxVec3 vPxTorque = {};
|
||||
XMStoreFloat3((_float3*)&vPxTorque, vDirection);
|
||||
static_cast<PSX::PxRigidDynamic*>(m_pRigidBody)->addForce(vPxTorque, eType);
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
{
|
||||
m_eActorType = Desc.eType;
|
||||
@@ -63,11 +82,6 @@ HRESULT CRigidBody::Initialize_Prototype(RIGIDBODY_PROTOTYPEDESC& Desc)
|
||||
m_fContactOffset = Desc.fContactOffset;
|
||||
m_vhalfGeometryInfo = Desc.vhalfGeometryInfo;
|
||||
m_fDensity = Desc.fDensity;
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Add_DebugShape())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -102,13 +116,62 @@ HRESULT CRigidBody::Initialize(void* pArg)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Initialize_UserData();
|
||||
m_pRigidBody->userData = &m_tagData;
|
||||
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
Add_DebugShape();
|
||||
if (FAILED(Add_DebugShape())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CRigidBody::Initialize_UserData()
|
||||
{
|
||||
switch (m_eActorType)
|
||||
{
|
||||
case Engine::ACTOR::BOX:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::CAPSULE:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::SPHERE:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_DYNAMIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::PLANE:
|
||||
break;
|
||||
case Engine::ACTOR::TRIANGLEMESH:
|
||||
m_tagData.eKind = PHYSX_KIND::BODY_STATIC;
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.m_BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
break;
|
||||
case Engine::ACTOR::HEIGHTFIELD:
|
||||
break;
|
||||
case Engine::ACTOR::END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
HRESULT CRigidBody::Add_DebugShape()
|
||||
{
|
||||
@@ -161,6 +224,9 @@ CComponent* CRigidBody::Clone(void* pArg, CGameObject* pOwner)
|
||||
|
||||
void CRigidBody::Free()
|
||||
{
|
||||
if (nullptr != m_pRigidBody) {
|
||||
m_pRigidBody = nullptr;
|
||||
}
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pTransform);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Shader.h"
|
||||
|
||||
CShader::CShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -19,10 +19,10 @@ CShader::CShader(const CShader& rhs)
|
||||
, m_iNumElements{ rhs.m_iNumElements }
|
||||
#endif
|
||||
{
|
||||
Safe_AddRef(m_pEffect);
|
||||
SAFE_ADDREF(m_pEffect);
|
||||
|
||||
for (auto& pInputLayout : m_InputLayouts)
|
||||
Safe_AddRef(pInputLayout);
|
||||
SAFE_ADDREF(pInputLayout);
|
||||
}
|
||||
|
||||
HRESULT CShader::Initialize_Prototype(const _tchar* pShaderFilePath, const D3D11_INPUT_ELEMENT_DESC* pElements, _uint iNumElements)
|
||||
@@ -153,8 +153,9 @@ HRESULT CShader::CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_E
|
||||
if (FAILED(m_pDevice->CreateInputLayout(
|
||||
pElements,
|
||||
iNumElements,
|
||||
PassDesc.pIAInputSignature/*쉐이더에서 받아줄수 있는 정점의 정보*/,
|
||||
PassDesc.IAInputSignatureSize/*쉐이더에서 받아줄수 있는 정점의 멤버변수갯수*/,
|
||||
PassDesc.pIAInputSignature/*쉐이더에서 받아줄수 있는 정점의 정보*/,
|
||||
PassDesc.IAInputSignatureSize/*쉐이더에서 받아줄수 있는 정점의 멤버변수갯수*/,
|
||||
|
||||
&pInputLayout)))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -167,7 +168,8 @@ HRESULT CShader::CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_E
|
||||
|
||||
HRESULT CShader::Shader_Refresh()
|
||||
{
|
||||
// 내 인풋 레이아웃 이펙트 소멸시키고
|
||||
// 내 인풋 레이아웃 이펙트 소멸시키고
|
||||
|
||||
Safe_Release(m_pEffect);
|
||||
|
||||
for (auto& pInputLayout : m_InputLayouts)
|
||||
@@ -175,10 +177,16 @@ HRESULT CShader::Shader_Refresh()
|
||||
|
||||
m_InputLayouts.clear();
|
||||
|
||||
//그 경로로 재 생성한다.
|
||||
|
||||
//그 경로로 재 생성한다.
|
||||
if (FAILED(CreateShader(m_strShaderPath.c_str(), m_pElements, m_iNumElements)))
|
||||
{
|
||||
MessageBox(NULL, L"쉐이더 변경 실패", L"System Message", MB_OK);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
MessageBox(NULL, L"쉐이더 변경 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -193,8 +201,9 @@ HRESULT CShader::Begin(_uint iPassIndex)
|
||||
|
||||
m_pContext->IASetInputLayout(m_InputLayouts[iPassIndex]);
|
||||
|
||||
/* Apply를 반드시 호출해야만 쉐이더로 그려진다. */
|
||||
/* Apply이전에 쉐이더에 전달할 모든 데이터들을 다 던져놓아야한다. */
|
||||
/* Apply를 반드시 호출해야만 쉐이더로 그려진다. */
|
||||
/* Apply이전에 쉐이더에 전달할 모든 데이터들을 다 던져놓아야한다. */
|
||||
|
||||
m_pEffect->GetTechniqueByIndex(0)->GetPassByIndex(iPassIndex)->Apply(0, m_pContext);
|
||||
|
||||
return S_OK;
|
||||
@@ -207,7 +216,7 @@ CShader* CShader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, c
|
||||
if (FAILED(pInstance->Initialize_Prototype(pShaderFilePath, pElements, iNumElements)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CShader");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -220,7 +229,7 @@ CComponent* CShader::Clone(void* pArg, class CGameObject* pOwner)
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CShader");
|
||||
Safe_Release(pInstance);
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
@@ -230,10 +239,10 @@ void CShader::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pEffect);
|
||||
SAFE_RELEASE(m_pEffect);
|
||||
|
||||
for (auto& pInputLayout : m_InputLayouts)
|
||||
Safe_Release(pInputLayout);
|
||||
SAFE_RELEASE(pInputLayout);
|
||||
|
||||
m_InputLayouts.clear();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user