[add] Goblin Dead
[add] Troll Stun [add] GoblinStat [add] Goblin DeadDisolve
This commit is contained in:
@@ -375,4 +375,21 @@ float3 Filmic_ToneMapper(float3 vColor)
|
||||
}
|
||||
|
||||
|
||||
float4 ApplyDissolve(Texture2D DisolveTexture, float fDisolveRatio, float fDisolveAmount, float fDisolveEdgeWidth, float4 vDisolveEdgeColor, float4 vMtrlDiffuse, float2 vTexcoord)
|
||||
{
|
||||
float4 vDisolve = DisolveTexture.Sample(DefaultSampler, vTexcoord);
|
||||
float fDisolveValue = vDisolve.r;
|
||||
|
||||
float fDisolveThreshold = saturate(fDisolveRatio + fDisolveAmount);
|
||||
|
||||
clip(fDisolveValue - fDisolveThreshold); // 진짜 잘려나감
|
||||
|
||||
float edgeWidth = max(fDisolveEdgeWidth, FLT_EPSILON5); // 불타는 라인
|
||||
float edgeFactor = smoothstep(fDisolveThreshold, fDisolveThreshold + edgeWidth, fDisolveValue);
|
||||
|
||||
vMtrlDiffuse.rgb = lerp(vDisolveEdgeColor.rgb, vMtrlDiffuse.rgb, edgeFactor);
|
||||
|
||||
return vMtrlDiffuse;
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -572,7 +572,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.f, 1.f, lerp(fVisibility_Dynamic_Near, fVisibility_Static, vDepthDesc.y));
|
||||
Out.vBackBuffer.rgb *= lerp(0.25f, 1.f, lerp(fVisibility_Dynamic_Near, fVisibility_Static, vDepthDesc.y));
|
||||
|
||||
|
||||
float4 vColor = 0.f;
|
||||
|
||||
@@ -520,6 +520,16 @@ _bool CGameInstance::isIn_LocalFrustum(_fvector vLocalPos, _float fRadius)
|
||||
return m_pPipeLine->isIn_LocalFrustum(vLocalPos, fRadius);
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Bind_GlobalSRV(CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName)
|
||||
{
|
||||
return m_pPipeLine->Bind_GlobalSRV(pShader, wszKeyGlobalSRV, pConstantName);
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder)
|
||||
{
|
||||
return m_pPipeLine->Load_GlobalSRV(wszKeyGlobalSRV, pathSRVFolder);
|
||||
}
|
||||
|
||||
void CGameInstance::Add_Light(_uint _iCurrentLevel, CLight* _pLight)
|
||||
{
|
||||
m_pLight_Manager->Add_Light(_iCurrentLevel, _pLight);
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
#include "pch.h"
|
||||
#include "PipeLine.h"
|
||||
#include "Shader.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
CPipeLine::CPipeLine()
|
||||
:m_pGameInstance(CGameInstance::GetInstance())
|
||||
{
|
||||
SAFE_ADDREF(m_pGameInstance);
|
||||
}
|
||||
|
||||
void CPipeLine::Set_Transform(D3DTS eState, _fmatrix TransformStateMatrix)
|
||||
@@ -63,6 +68,29 @@ _bool CPipeLine::isIn_LocalFrustum(_fvector vLocalPos, _float fRadius)
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT CPipeLine::Bind_GlobalSRV(CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName)
|
||||
{
|
||||
ID3D11ShaderResourceView* pSRV = Find_GlobalShader(wszKeyGlobalSRV);
|
||||
if (FAILED(pShader->Bind_SRV(pConstantName, pSRV))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPipeLine::Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder)
|
||||
{
|
||||
ID3D11ShaderResourceView* pSRV = Find_GlobalShader(wszKeyGlobalSRV);
|
||||
if (nullptr != pSRV) {
|
||||
return E_FAIL;
|
||||
}
|
||||
pSRV = m_pGameInstance->Add_Resource(pathSRVFolder.string().c_str());
|
||||
if (nullptr == pSRV) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_mapGlobalSRV.emplace(wszKeyGlobalSRV, pSRV);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPipeLine::Update()
|
||||
{
|
||||
for (_uint i = ENUM_CLASS(D3DTS::VIEW_INV); i < ENUM_CLASS(D3DTS::END); ++i)
|
||||
@@ -112,6 +140,15 @@ void CPipeLine::Make_Planes(const _float4* pPoints, _float4* pPlanes)
|
||||
XMStoreFloat4(&pPlanes[5], XMPlaneFromPoints(XMLoadFloat4(&pPoints[0]), XMLoadFloat4(&pPoints[1]), XMLoadFloat4(&pPoints[2])));
|
||||
}
|
||||
|
||||
ID3D11ShaderResourceView* CPipeLine::Find_GlobalShader(const _tchar* wszKeyGlobalSRV)
|
||||
{
|
||||
auto iter = m_mapGlobalSRV.find(wszKeyGlobalSRV);
|
||||
if (iter == m_mapGlobalSRV.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return (*iter).second;
|
||||
}
|
||||
|
||||
CPipeLine* CPipeLine::Create()
|
||||
{
|
||||
CPipeLine* pInstance = new CPipeLine();
|
||||
@@ -127,4 +164,9 @@ CPipeLine* CPipeLine::Create()
|
||||
void CPipeLine::Free()
|
||||
{
|
||||
__super::Free();
|
||||
for (auto& pairSRV : m_mapGlobalSRV) {
|
||||
SAFE_RELEASE(pairSRV.second);
|
||||
}
|
||||
m_mapGlobalSRV.clear();
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
@@ -137,13 +137,18 @@ HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal)
|
||||
m_pRigidBody->setAngularVelocity(PSX::PxZERO()); // DO 객체 이동 제거
|
||||
m_pRigidBody->setLinearVelocity(PSX::PxZERO());
|
||||
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody); // 현재 액터 비활성화
|
||||
m_bActive = false;
|
||||
Detach_Actor();
|
||||
CCTOriginal.SetActive(true);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CRigidBody_Dynamic::Detach_Actor()
|
||||
{
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody); // 현재 액터 비활성화
|
||||
m_bActive = false;
|
||||
}
|
||||
|
||||
_vector CRigidBody_Dynamic::Get_Position()
|
||||
{
|
||||
PSX::PxVec3 pxPos = m_pRigidBody->getGlobalPose().p;
|
||||
|
||||
@@ -122,7 +122,7 @@ _bool CStat::Get_Damage(_float fDamage)
|
||||
{
|
||||
_bool bResultDead = { false };
|
||||
_float fCurHp = Get_Stat(ENUM_CLASS(STAT::HP)) - fDamage;
|
||||
if (fCurHp < 0) { fCurHp = 0; bResultDead = true; }
|
||||
if (fCurHp <= 0) { fCurHp = 0; bResultDead = true; }
|
||||
Set_Stat(ENUM_CLASS(STAT::HP), fCurHp);
|
||||
return bResultDead;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class ENGINE_DLL CComponent abstract : public CBase
|
||||
|
||||
public:
|
||||
virtual HRESULT Render() { return S_OK; }
|
||||
virtual class CGameObject* Get_Owner() { return m_pOwner; }
|
||||
|
||||
protected:
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
@@ -35,4 +36,4 @@ class ENGINE_DLL CComponent abstract : public CBase
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
NS_END
|
||||
|
||||
@@ -400,7 +400,7 @@ typedef struct tagOnCollsionInfo
|
||||
_float4 vWorldNomal = {}; // 접촉노말
|
||||
_float4 vHitDir = {}; // 시도한 move 방향
|
||||
_float fLength = {}; // 작용된 힘
|
||||
|
||||
class CGameObject* pObject = { nullptr }; // 시전자
|
||||
}ON_COLLISION_INFO;
|
||||
|
||||
typedef struct tagKeyFrameDesc
|
||||
|
||||
@@ -138,6 +138,8 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
void Transform_Frustum_ToLocalSpace(_fmatrix WorldMatrixInverse);
|
||||
_bool isIn_WorldFrustum(_fvector vWorldPos, _float fRadius);
|
||||
_bool isIn_LocalFrustum(_fvector vLocalPos, _float fRadius);
|
||||
HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName);
|
||||
HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder);
|
||||
|
||||
#pragma endregion
|
||||
#pragma region LIGHT_MANAGER
|
||||
|
||||
@@ -21,11 +21,13 @@ class CPipeLine final : public CBase
|
||||
_bool isIn_WorldFrustum(_fvector vWorldPos, _float fRadius);
|
||||
_bool isIn_LocalFrustum(_fvector vLocalPos, _float fRadius);
|
||||
|
||||
|
||||
HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName);
|
||||
HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder);
|
||||
public:
|
||||
void Update();
|
||||
|
||||
private:
|
||||
class CGameInstance* m_pGameInstance = { nullptr };
|
||||
_float4x4 m_TransformStateMatrices[ENUM_CLASS(D3DTS::END)] = {};
|
||||
_float4 m_vCamPosition = {};
|
||||
|
||||
@@ -34,9 +36,12 @@ class CPipeLine final : public CBase
|
||||
_float4 m_vWorldPlanes[6] = {};
|
||||
_float4 m_vLocalPlanes[6] = {};
|
||||
|
||||
unordered_map<_wstring, ID3D11ShaderResourceView*> m_mapGlobalSRV = {};
|
||||
private:
|
||||
HRESULT Initialize();
|
||||
void Make_Planes(const _float4* pPoints, _float4* pPlanes);
|
||||
ID3D11ShaderResourceView* Find_GlobalShader(const _tchar* wszKeyGlobalSRV);
|
||||
|
||||
public:
|
||||
static CPipeLine* Create();
|
||||
virtual void Free() override;
|
||||
|
||||
@@ -44,6 +44,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
|
||||
void Set_Kinematic(_bool bKinematic);
|
||||
|
||||
HRESULT ConvertToCCT(class CCharacter_Controller& CCTOriginal);
|
||||
void Detach_Actor();
|
||||
_bool IsActive() const { return m_bActive; }
|
||||
void SetActive(_bool bCondition) { m_bActive = bCondition; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user