diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp index b35ee6116..108a3de50 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp @@ -342,25 +342,35 @@ HRESULT CGoblin_Assassin::Render_Shadow(SHADOW eType) HRESULT CGoblin_Assassin::Render_MotionTrail(ID3D11ShaderResourceView* pSRV) { - _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); - for (_uint i = 0; i < iNumMeshes; i++) { - if (FAILED(m_pShaderCom->Bind_Matrices("g_OffsetMatrix", m_pModelCom->Get_OffsetMatrix(i).data(), - (_int)m_pModelCom->Get_OffsetMatrix(i).size()))) { + ID3D11RasterizerState* pPrevRS = nullptr; + m_pContext->RSGetState(&pPrevRS); + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size()))) return E_FAIL; - } - if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) return E_FAIL; - } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { + + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) return E_FAIL; - } + + m_pContext->RSSetState(m_pRS_Wireframe); m_pContext->VSSetShaderResources(26, 1, &pSRV); - if (FAILED(m_pModelCom->Render(i))) { + if (FAILED(m_pModelCom->Render(i))) return E_FAIL; - } } + + m_pContext->RSSetState(pPrevRS); + if (pPrevRS) SAFE_RELEASE(pPrevRS); + return S_OK; } @@ -540,6 +550,17 @@ HRESULT CGoblin_Assassin::Ready_Components() } } + D3D11_RASTERIZER_DESC rsDesc{}; + rsDesc.FillMode = D3D11_FILL_WIREFRAME; + rsDesc.CullMode = D3D11_CULL_NONE; + rsDesc.DepthClipEnable = TRUE; + + HRESULT hr = m_pDevice->CreateRasterizerState(&rsDesc, &m_pRS_Wireframe); + if (FAILED(hr)) + return E_FAIL; + + + return S_OK; } @@ -693,8 +714,10 @@ void CGoblin_Assassin::Free() SAFE_RELEASE(m_pGoblin_Particle); SAFE_RELEASE(m_pGoblin_Particle2); SAFE_RELEASE(m_pEffectPool); + SAFE_RELEASE(m_pRS_Wireframe); Safe_Delete(m_pCallBack_Behavior); Safe_Delete(m_pCallBack_HitReport); + } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp index 3b24a2d10..018fe4de3 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp @@ -315,6 +315,11 @@ HRESULT CGoblin_Assassin_Spector::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; } + + _float Intensity = 0.f; + if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp index 77348aaa1..977d57ce3 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp @@ -296,6 +296,10 @@ HRESULT CGoblin_Spector::Bind_ShaderResources() if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; } + _float Intensity = 0.f; + if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index e9088015e..2b3dc0930 100644 --- a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp @@ -80,6 +80,9 @@ HRESULT CNPC_Ollivander::Render() if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } + if (FAILED(Bind_ShaderParameters(i))) { + return E_FAIL; + } if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } @@ -175,6 +178,41 @@ HRESULT CNPC_Ollivander::Bind_ShaderResources() return S_OK; } +HRESULT CNPC_Ollivander::Bind_ShaderParameters(_uint iMeshOrder) +{ + _bool bUseColorMixer = false; + + _uint iColorParam = { UINT_MAX }; + _float fMixerFactor = { FLT_MAX }; + _uint iColorMixerMethod = { 0 }; + + switch (m_pModelCom->Get_UsingPass(iMeshOrder, m_pShaderCom)) + { + case 23: + { + bUseColorMixer = true; + iColorParam = 0x2E2E2E; + fMixerFactor = 0.9f; + iColorMixerMethod = 1; + } + break; + } + if (true == bUseColorMixer) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iPackedBlendColor", &iColorParam, sizeof(_uint)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fMixerFactor", &fMixerFactor, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iColorMixerMethod", &iColorMixerMethod, sizeof(_uint)))) { + return E_FAIL; + } + } + return S_OK; +} + HRESULT CNPC_Ollivander::Initialize_Prototype() { return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index d4c0361b1..58e341afe 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -156,6 +156,13 @@ void CPlayer::Update(_float fTimeDelta) m_pInfoInstance->Set_PlayerPos(m_pTransformCom->Get_State(STATE::POSITION)); + //_vector vRot = XMLoadFloat3(&m_pTransformCom->Get_Rotation()); + + //vRot = XMVectorSet(XMVectorGetX(vRot), XMVectorGetY(vRot), 0.f, 0.f); + + //m_pTransformCom->Rotation(XMConvertToRadians(vRot.m128_f32[0]), XMConvertToRadians(vRot.m128_f32[1]), XMConvertToRadians(vRot.m128_f32[2])); + + } void CPlayer::Late_Update(_float fTimeDelta) @@ -187,18 +194,16 @@ void CPlayer::Late_Update(_float fTimeDelta) { m_pTransformCom->LookAt_Horizontal_Lerp(m_LockOnInfo.pUnit->Get_WorldPostion(), fTimeDelta, 5.f); } - //////////////////////////////////////////////////////////////////////////// - _vector look = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); + //_vector look = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); - _vector worldUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + //_vector worldUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - _vector right = XMVector3Normalize(XMVector3Cross(worldUp, look)); - _vector up = XMVector3Normalize(XMVector3Cross(look, right)); + //_vector right = XMVector3Normalize(XMVector3Cross(worldUp, look)); + //_vector up = XMVector3Normalize(XMVector3Cross(look, right)); - m_pTransformCom->Set_State(STATE::RIGHT, right); - m_pTransformCom->Set_State(STATE::UP, up); - m_pTransformCom->Set_State(STATE::LOOK, look); - //////////////////////////////////////////////////////////////////////////// + //m_pTransformCom->Set_State(STATE::RIGHT, right); + //m_pTransformCom->Set_State(STATE::UP, up); + //m_pTransformCom->Set_State(STATE::LOOK, look); } diff --git a/Jusin154_Team3D/Client/Private/RandomNpc.cpp b/Jusin154_Team3D/Client/Private/RandomNpc.cpp index ebcfb5905..d0051e386 100644 --- a/Jusin154_Team3D/Client/Private/RandomNpc.cpp +++ b/Jusin154_Team3D/Client/Private/RandomNpc.cpp @@ -73,7 +73,9 @@ void CRandomNpc::Update(_float fTimeDelta) m_pCallBack_HitReport->Set_CurrentSlop(); } - /*m_pNPCInteraction->Set_Visible(0 < m_iEntered);*/ + m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); + + m_pInfoInstance->Set_PlayerPos(m_pTransformCom->Get_State(STATE::POSITION)); } void CRandomNpc::Late_Update(_float fTimeDelta) @@ -109,6 +111,9 @@ HRESULT CRandomNpc::Render() if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } + if (FAILED(Bind_ShaderParameters(i))) { + return E_FAIL; + } if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } @@ -204,6 +209,48 @@ HRESULT CRandomNpc::Bind_ShaderResources() return S_OK; } +HRESULT CRandomNpc::Bind_ShaderParameters(_uint iMeshOrder) +{ + _bool bUseColorMixer = false; + + _uint iColorParam = { UINT_MAX }; + _float fMixerFactor = { FLT_MAX }; + _uint iColorMixerMethod = { 0 }; + + switch (m_pModelCom->Get_UsingPass(iMeshOrder,m_pShaderCom)) + { + case 23: + if (m_strModelPrototypeTag == TEXT("Prototype_Component_F_Student_Model")) + { + bUseColorMixer = true; + iColorParam = 0x2E2E2E; + fMixerFactor = 0.00f; + iColorMixerMethod = 1; + } + else { + bUseColorMixer = true; + iColorParam = 0x2E2E2E; + fMixerFactor = 0.9f; + iColorMixerMethod = 1; + } + break; + } + if (true == bUseColorMixer) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_iPackedBlendColor", &iColorParam, sizeof(_uint)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fMixerFactor", &fMixerFactor, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_iColorMixerMethod", &iColorMixerMethod, sizeof(_uint)))) { + return E_FAIL; + } + } + return S_OK; +} + HRESULT CRandomNpc::Ready_Components(void* pArg) { CTransform::TRANSFORM_DESC Desc = {}; @@ -303,12 +350,6 @@ HRESULT CRandomNpc::Ready_Components(void* pArg) } } - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pNPCInteraction))) { - // return E_FAIL; - //} - - //m_pNPCInteraction->NpcInfo(m_pNpcStat->Get_Stat().pNpc_Name); - return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Goblin_Assassin.h b/Jusin154_Team3D/Client/Public/Goblin_Assassin.h index ede27e23a..b695a0291 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_Assassin.h +++ b/Jusin154_Team3D/Client/Public/Goblin_Assassin.h @@ -54,6 +54,8 @@ class CGoblin_Assassin final : public CMonster class CEffectParts* m_pGoblin_Particle = { nullptr }; class CEffectParts* m_pGoblin_Particle2 = { nullptr }; class CGoblin_Assassin_Spector* m_pGoblinSpector = { nullptr }; + + ID3D11RasterizerState* m_pRS_Wireframe = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h index 55db63f8b..1ec66c219 100644 --- a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h +++ b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h @@ -47,6 +47,7 @@ class CNPC_Ollivander final : public CUnit virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources() override; + HRESULT Bind_ShaderParameters(_uint iMeshOrder); public: static CNPC_Ollivander* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/RandomNpc.h b/Jusin154_Team3D/Client/Public/RandomNpc.h index 338fdf82c..c3ebef544 100644 --- a/Jusin154_Team3D/Client/Public/RandomNpc.h +++ b/Jusin154_Team3D/Client/Public/RandomNpc.h @@ -48,6 +48,7 @@ class CRandomNpc final : public CUnit virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources() override; + HRESULT Bind_ShaderParameters(_uint iMeshOrder); public: static CRandomNpc* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml index 364c376e4..7a732788e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml @@ -6,7 +6,7 @@ - - + + \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Elf/Elf.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Elf/Elf.xml index 11d78bb72..f466511f4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Elf/Elf.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Elf/Elf.xml @@ -61,7 +61,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/F_Student/F_Student.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/F_Student/F_Student.xml index 4b1bc0b33..f28cb4a5d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/F_Student/F_Student.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/F_Student/F_Student.xml @@ -88,7 +88,7 @@ - + @@ -177,7 +177,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.xml index b1a8459aa..41dace815 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.xml @@ -1,5 +1,5 @@ - + @@ -144,7 +144,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Ghost_Peeves/Ghost_Peeves.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Ghost_Peeves/Ghost_Peeves.xml index fdefae55a..9ba641dbd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Ghost_Peeves/Ghost_Peeves.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Ghost_Peeves/Ghost_Peeves.xml @@ -87,7 +87,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/M_Student/M_Student.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/M_Student/M_Student.xml index d2fe87dfd..d7f49c880 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/M_Student/M_Student.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/M_Student/M_Student.xml @@ -1,6 +1,6 @@ - + @@ -155,7 +155,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/MatildaWeasely/MatildaWeasely.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/MatildaWeasely/MatildaWeasely.xml index ae9ff304f..9883e7257 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/MatildaWeasely/MatildaWeasely.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/MatildaWeasely/MatildaWeasely.xml @@ -1,6 +1,6 @@ - + @@ -184,7 +184,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/PhineasBlack/PhineasBlack.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/PhineasBlack/PhineasBlack.xml index 9b882f55e..aa02c7caf 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/PhineasBlack/PhineasBlack.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/PhineasBlack/PhineasBlack.xml @@ -30,7 +30,7 @@ - + @@ -185,7 +185,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/SatyavatiShah/SatyavatiShah.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/SatyavatiShah/SatyavatiShah.xml index 815d2a167..a3f031e15 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/SatyavatiShah/SatyavatiShah.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/SatyavatiShah/SatyavatiShah.xml @@ -1,5 +1,5 @@ - + @@ -207,7 +207,7 @@ - + diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 68d580320..e412ba1f7 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -112,6 +112,20 @@ HRESULT CModel::Begin(_uint iMeshIndex, CShader* pShader) return hr; } +_int CModel::Get_UsingPass(_uint iMeshIndex, CShader* pShader) +{ + if (iMeshIndex >= m_iNumMeshes) { + return E_FAIL; + } + + _uint iMaterialIndex = m_Meshes[iMeshIndex]->Get_MaterialIndex(); + + if (iMaterialIndex >= m_iNumMaterials) { + return E_FAIL; + } + return m_Materials[iMaterialIndex]->Get_UsingPass(); +} + HRESULT CModel::Bind_BoneMatrices(_uint iMeshIndex, CShader* pShader, const _char* pConstantName) { if (iMeshIndex >= m_iNumMeshes) { @@ -538,10 +552,14 @@ void CModel::Update_RootBone(_float Amount) _float4 axis; XMStoreFloat4(&axis, axisWorld); - swap(axis.z, axis.y); - if (m_bRootBone) { - m_pTransform->TurnAngle(axis, angle); + _float yaw = 0.f; + + { + _vector up = XMVectorSet(0.f, 1.f, 0.f, 0.f); + yaw = XMVectorGetY(axisWorld) * angle; } + m_pTransform->TurnAngle(axis, yaw); + } XMStoreFloat4(&m_vPrevRootRot, qCur); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index ec6bc4405..8b4513fd9 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -133,6 +133,7 @@ class ENGINE_DLL CModel final : public CComponent #pragma region Material HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader); HRESULT Begin(_uint iMeshIndex, class CShader* pShader); + _int Get_UsingPass(_uint iMeshIndex, CShader* pShader); #pragma endregion void ComputeAnimation(_uint AnimIndex, _uint MeshIndex);