Compare commits
41
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9f9509b99 | ||
|
|
f593a52f8d | ||
|
|
2f4a475699 | ||
|
|
713eb3e81f | ||
|
|
d7a276bb83 | ||
|
|
d23dfb722b | ||
|
|
8f47add992 | ||
|
|
782c0000ff | ||
|
|
a6e88902ff | ||
|
|
1c5764a4ce | ||
|
|
f03d4e9a0a | ||
|
|
5f5b61ef53 | ||
|
|
94de3a4dfa | ||
|
|
9b9f111882 | ||
|
|
ad89ab0a75 | ||
|
|
a5941affee | ||
|
|
0c96778a13 | ||
|
|
6b71fd7b03 | ||
|
|
0767ce2cdd | ||
|
|
957f66bd65 | ||
|
|
9665947199 | ||
|
|
af32338f22 | ||
|
|
a283d51e7c | ||
|
|
426a48965d | ||
|
|
c80f452a5f | ||
|
|
9d7c195dc5 | ||
|
|
0b12cc08c3 | ||
|
|
43f6ad7d13 | ||
|
|
ea4cbc63c1 | ||
|
|
6b79c126ee | ||
|
|
e5e3f2ddcd | ||
|
|
87aac428da | ||
|
|
9ef9d5b04a | ||
|
|
3bc1995e34 | ||
|
|
9af481e66a | ||
|
|
56fa04d8fa | ||
|
|
93e259e711 | ||
|
|
19424fd9d8 | ||
|
|
a54e0584aa | ||
|
|
1954c0274f | ||
|
|
e89d8b6bcb |
+1
-1
@@ -39,4 +39,4 @@ enc_temp_folder/
|
||||
Jusin154_Team3D/Client/Bin/Resources/
|
||||
|
||||
# Imgui 임시 파일
|
||||
imgui.ini
|
||||
imgui.ini
|
||||
|
||||
@@ -71,7 +71,6 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_PriorityUpdate")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -99,7 +98,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_FrameCount")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
_float fTimeAcc = { };
|
||||
@@ -124,26 +123,18 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
|
||||
if (fTimeAcc >= 1.f / 60.f)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
pGameInstance->Compute_TimeDelta(TEXT("Timer_FrameCount"));
|
||||
#endif // _DEBUG
|
||||
|
||||
pGameInstance->Compute_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
#ifdef _DEBUG
|
||||
pMainApp->Update(1.f / 60.f);
|
||||
#endif // _DEBUG
|
||||
#ifndef _DEBUG
|
||||
_float fFrameTime = min(pGameInstance->Get_TimeDelta(TEXT("Timer_60")), fMaxTimer);
|
||||
pMainApp->Update(fFrameTime);
|
||||
#endif
|
||||
|
||||
pMainApp->Render();
|
||||
|
||||
fTimeAcc = 0.f;
|
||||
#ifdef _DEBUG
|
||||
pGameInstance->Compute_TimeDelta(TEXT("Timer_FrameCount"));
|
||||
pMainApp->Compute_FrameCount();
|
||||
#endif // _DEBUG
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,24 +192,24 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
|
||||
g_hWnd = hWnd;
|
||||
|
||||
#ifndef _DEBUG
|
||||
{
|
||||
g_bFullscreen = true;
|
||||
|
||||
SetWindowLong(g_hWnd, GWL_STYLE, GetWindowLong(g_hWnd, GWL_STYLE) & ~WS_OVERLAPPEDWINDOW);
|
||||
|
||||
_int screenX = GetSystemMetrics(SM_CXSCREEN);
|
||||
_int screenY = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
SetWindowPos(
|
||||
g_hWnd,
|
||||
HWND_TOP,
|
||||
0, 0,
|
||||
screenX, screenY,
|
||||
SWP_NOOWNERZORDER | SWP_FRAMECHANGED
|
||||
);
|
||||
}
|
||||
#endif
|
||||
//#ifndef _DEBUG
|
||||
// {
|
||||
// g_bFullscreen = true;
|
||||
//
|
||||
// SetWindowLong(g_hWnd, GWL_STYLE, GetWindowLong(g_hWnd, GWL_STYLE) & ~WS_OVERLAPPEDWINDOW);
|
||||
//
|
||||
// _int screenX = GetSystemMetrics(SM_CXSCREEN);
|
||||
// _int screenY = GetSystemMetrics(SM_CYSCREEN);
|
||||
//
|
||||
// SetWindowPos(
|
||||
// g_hWnd,
|
||||
// HWND_TOP,
|
||||
// 0, 0,
|
||||
// screenX, screenY,
|
||||
// SWP_NOOWNERZORDER | SWP_FRAMECHANGED
|
||||
// );
|
||||
// }
|
||||
//#endif
|
||||
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -406,8 +406,9 @@ void CBroom::PlayerInput(_float fTimeDelta)
|
||||
m_Input.bTurbo = false;
|
||||
m_pInfoInstance->Event_CallBack(TEXT("BroomBooster"), &m_Input.bTurbo);
|
||||
}
|
||||
|
||||
#ifndef DEBUG_SHADOW
|
||||
m_bTurbo = m_Input.bTurbo;
|
||||
#endif // !DEBUG_SHADOW
|
||||
}
|
||||
|
||||
void CBroom::Set_AISpeed(_float speedMul, _float accelMul)
|
||||
|
||||
@@ -109,6 +109,7 @@ HRESULT CBroomRacerAI::Initialize(void* pArg)
|
||||
|
||||
void CBroomRacerAI::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,14 +34,17 @@ void CBuildingContainer::Update(_float fTimeDelta)
|
||||
|
||||
void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
const _float fDepthOcclusionThreshold = m_pGameInstance->Get_DepthOcclusionThreshold();
|
||||
|
||||
if (m_pGameInstance->IsIn_WorldFrustum(XMVectorSetW(XMLoadFloat3(&m_vExtentWorldPosition), 1.f), m_fRadius)) {
|
||||
if (m_fCamDepth > 300.f)
|
||||
if (m_fCamDepth > fDepthOcclusionThreshold)
|
||||
{
|
||||
if (m_pOcclusionQueryCom->isDraw())
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
else
|
||||
else {
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this);
|
||||
|
||||
|
||||
@@ -130,26 +130,56 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
static _bool m_bRenderSystem = false;
|
||||
if (m_pGameInstance->Key_Up(DIK_F6)) {
|
||||
m_bRenderSystem = !m_bRenderSystem;
|
||||
}
|
||||
if (true == m_bRenderSystem) {
|
||||
Describe_Entity();
|
||||
}
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
#ifndef _DEBUG
|
||||
if (dynamic_cast<CPlayer*>(m_pOwner)->Get_UIState() == UI_STATE::GAMEPLAYER)
|
||||
//#ifndef _DEBUG
|
||||
//if (dynamic_cast<CPlayer*>(m_pOwner)->Get_UIState() == UI_STATE::GAMEPLAYER)
|
||||
//{
|
||||
// m_bMovable = true;
|
||||
//}
|
||||
//else {
|
||||
// m_bMovable = false;
|
||||
//}
|
||||
|
||||
//if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
// m_bMovable = !m_bMovable;
|
||||
//}
|
||||
//
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE))
|
||||
{
|
||||
m_bFreeze = !m_bFreeze;
|
||||
}
|
||||
|
||||
if (m_bFreeze)
|
||||
{
|
||||
m_bMovable = false;
|
||||
}
|
||||
else if (m_bDebugMove)
|
||||
{
|
||||
m_bMovable = true;
|
||||
}
|
||||
else {
|
||||
m_bMovable = false;
|
||||
else
|
||||
{
|
||||
if (auto pPlayer = dynamic_cast<CPlayer*>(m_pOwner))
|
||||
m_bMovable = (pPlayer->Get_UIState() == UI_STATE::GAMEPLAYER);
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
//#endif // _DEBUG
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_PGDN)) {
|
||||
m_bDampingParentPos = !m_bDampingParentPos;
|
||||
}
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Mouse_Down(DIM_MBUTTON)) {
|
||||
m_pGameInstance->Toggle_MouseCenter();
|
||||
}
|
||||
@@ -207,10 +237,33 @@ void CCamPosition_Shoulder::Late_Update(_float fTimeDelta)
|
||||
}
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::UI_OVERLAY, this);
|
||||
}
|
||||
#ifdef DEBUG_CAMERAS
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
|
||||
#endif // DEBUG_CAMERAS
|
||||
}
|
||||
|
||||
HRESULT CCamPosition_Shoulder::Render()
|
||||
{
|
||||
RENDER eType = m_pGameInstance->Get_CurrentRenderPass();
|
||||
if (RENDER::NONLIGHT == eType) {
|
||||
#ifdef DEBUG_CAMERAS
|
||||
m_Batch->Begin();
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x0000ff, 1.f);
|
||||
if (m_bRenderLookPos) {
|
||||
m_pSubShape->Draw(m_pLookTransform->Get_XMWorldMatrix(), ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
}
|
||||
if (m_bRenderHeadPos) {
|
||||
vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0000, 1.f);
|
||||
_vector vDestPos = Calc_DampingParentPos();
|
||||
_vector vHeadPos = vDestPos + XMVectorSet(0.f, m_fHeadHeight, 0.f, 0.f);
|
||||
m_pSubShape->Draw(XMMatrixTranslationFromVector(vHeadPos), ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
}
|
||||
m_Batch->End();
|
||||
#endif // DEBUG_CAMERAS
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -278,7 +331,23 @@ _vector CCamPosition_Shoulder::Calc_BestPosition(_fvector vCastingPosition, _gve
|
||||
_bool bHit = m_pGameInstance->SphereCast(0.25f, vCastingPosition, vCastingDirection, fZeroSafeDistance,
|
||||
PSX::PxHitFlag::eDEFAULT, PSX::PxQueryFlag::eSTATIC/*|PSX::PxQueryFlag::eDYNAMIC*/, m_BufferHit);
|
||||
|
||||
// 벽면에서 팔로우 타겟을 살짝 띄우는 오프셋
|
||||
|
||||
static _float fCameraSurfaceOffset = 0.20f; // 높이면 카메라가 벽으로부터 좀 더 안정적으로 띄워지지만 벽에 바짝 붙은 플레이어를 감당불가
|
||||
static _float fCameraMinDistance = 0.71f; // 높이면
|
||||
|
||||
#ifdef DEBUG_CAMERAS
|
||||
GUI::Begin("CAMERA");
|
||||
if (GUI::TreeNode("MinSurfaceOffset")) {
|
||||
GUI::DragFloat("fMinDistance", &fCameraMinDistance, 0.01f, 0.01f, 1.f);
|
||||
GUI::DragFloat("fSurfaceOffset", &fCameraSurfaceOffset, 0.01f, 0.01f, 1.f);
|
||||
GUI::TreePop();
|
||||
}
|
||||
GUI::End();
|
||||
#endif // DEBUG_CAMERAS
|
||||
|
||||
if (false == bHit) {
|
||||
m_fFocalRatioTargetValue = m_vFocalRatio.y;
|
||||
return vCastingPosition + vCastingDirection * fZeroSafeDistance;
|
||||
}
|
||||
|
||||
@@ -299,20 +368,6 @@ _vector CCamPosition_Shoulder::Calc_BestPosition(_fvector vCastingPosition, _gve
|
||||
}
|
||||
CMyTools::SortHitsByDistance(sweepHits);
|
||||
|
||||
// 벽면에서 팔로우 타겟을 살짝 띄우는 오프셋
|
||||
|
||||
static _float fCameraSurfaceOffset = 0.20f; // 높이면 카메라가 벽으로부터 좀 더 안정적으로 띄워지지만 벽에 바짝 붙은 플레이어를 감당불가
|
||||
static _float fCameraMinDistance = 0.71f; // 높이면
|
||||
|
||||
#ifdef _DEBUG
|
||||
GUI::Begin("CAMERA");
|
||||
if (GUI::TreeNode("MinSurfaceOffset")) {
|
||||
GUI::DragFloat("fCameraMinDistance", &fCameraMinDistance, 0.01f, 0.01f, 1.f);
|
||||
GUI::DragFloat("fCameraSurfaceOffset", &fCameraSurfaceOffset, 0.01f, 0.01f, 1.f);
|
||||
GUI::TreePop();
|
||||
}
|
||||
GUI::End();
|
||||
#endif // _DEBUG
|
||||
|
||||
_float fDistance = { };
|
||||
_float fFinalTargetDistance = fZeroSafeDistance;
|
||||
@@ -468,6 +523,10 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_CAMERAS
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.25f, 12, false, false));
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
#endif // DEBUG_CAMERAS
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -503,7 +562,7 @@ void CCamPosition_Shoulder::Free()
|
||||
SAFE_RELEASE(m_pTarget_LookPart);
|
||||
SAFE_RELEASE(m_pTarget_FollowPart);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
|
||||
void CCamPosition_Shoulder::Describe_Entity()
|
||||
{
|
||||
@@ -512,16 +571,22 @@ void CCamPosition_Shoulder::Describe_Entity()
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
|
||||
GUI::Text("fMouseSensor : %.1f", m_fMouseSensor);
|
||||
GUI::SliderFloat("m_fFollowTargetIncludedAngleDegree", &m_fFollowTargetIncludedAngleDegree, -360.f, 360.f, "%.1f");
|
||||
GUI::SliderFloat("m_fDefaultCameraBackToFrontRatio", &m_fDefaultCameraBackToFrontRatio, -1.f, 1.f);
|
||||
GUI::SliderFloat("m_vFocalRatio", &m_vFocalRatio.x, 0.f, 1.f);
|
||||
GUI::SliderFloat("m_fCameraFowardDistance", &m_fCameraFowardDistance, 0.f, 4.f);
|
||||
GUI::Text("%.2f", XMConvertToDegrees(m_pBinded_Camera->Get_Fov()));
|
||||
GUI::SliderFloat("FollowTarget_IncludedAngle", &m_fFollowTargetIncludedAngleDegree, -360.f, 360.f, "%.1f");
|
||||
GUI::SliderFloat("CameraBackToFrontRatio", &m_fDefaultCameraBackToFrontRatio, -1.f, 1.f);
|
||||
GUI::SliderFloat("FocalRatio", &m_vFocalRatio.x, 0.f, 1.f);
|
||||
GUI::SliderFloat("CameraFowardDistance", &m_fCameraFowardDistance, 0.f, 4.f);
|
||||
GUI::Text("FOV %.2f", XMConvertToDegrees(m_pBinded_Camera->Get_Fov()));
|
||||
#ifdef DEBUG_CAMERAS
|
||||
GUI::Checkbox("RenderLookPos", &m_bRenderLookPos);
|
||||
GUI::Checkbox("RenderHeadPos", &m_bRenderHeadPos);
|
||||
#endif // DEBUG_CAMERAS
|
||||
|
||||
#ifdef _DEBUG
|
||||
GUI::Text("%d", m_bSpellFovLerp);
|
||||
GUI::SliderFloat3("m_vSpellFovLerpTimer", (_float*)&m_vSpellFovLerpTimer, 0.f, 5.f);
|
||||
GUI::SliderFloat3("m_vSpellFovLerpDegree", (_float*)&m_vSpellFovLerpDegree, 1.f, 60.f);
|
||||
|
||||
|
||||
GUI::SliderFloat3("m_vSpellFovLerpTimer", (_float*)&m_vSpellFovLerpTimer, 0.f, 5.f);
|
||||
GUI::SliderFloat3("m_vSpellFovLerpDegree", (_float*)&m_vSpellFovLerpDegree, 1.f, 60.f);
|
||||
|
||||
|
||||
if (GUI::TreeNode("AnimList")) {
|
||||
for (_int i = 0; i < m_pModelCom->Get_AnimSize(); i++)
|
||||
{
|
||||
@@ -534,9 +599,10 @@ void CCamPosition_Shoulder::Describe_Entity()
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
#endif // _DEBUG
|
||||
m_pBinded_Camera->Describe_Entity();
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
@@ -44,18 +44,13 @@ void CCamera_Cinematic::Update(_float fTimeDelta)
|
||||
}
|
||||
void CCamera_Cinematic::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (false == m_bActive) {
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
|
||||
#endif // _DEBUG
|
||||
return;
|
||||
}
|
||||
else {
|
||||
}
|
||||
#ifdef DEBUG_CAMERAS
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
|
||||
#endif // DEBUG_CAMERAS
|
||||
}
|
||||
HRESULT CCamera_Cinematic::Render() {
|
||||
#ifdef _DEBUG
|
||||
#ifdef DEBUG_CAMERAS
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -96,7 +91,7 @@ HRESULT CCamera_Cinematic::Render() {
|
||||
|
||||
|
||||
}
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -253,11 +248,11 @@ HRESULT CCamera_Cinematic::Initialize(void* pArg)
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#ifdef DEBUG_CAMERAS
|
||||
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.25f, 12, false, false));
|
||||
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CCamera_Cinematic::Ready_Components(void* pArg)
|
||||
@@ -265,7 +260,7 @@ HRESULT CCamera_Cinematic::Ready_Components(void* pArg)
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef DEBUG_CAMERAS
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Camera_Model"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom)))) {
|
||||
return E_FAIL;
|
||||
@@ -276,7 +271,7 @@ HRESULT CCamera_Cinematic::Ready_Components(void* pArg)
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -299,7 +294,7 @@ HRESULT CCamera_Cinematic::Ready_SubPart()
|
||||
|
||||
HRESULT CCamera_Cinematic::Bind_ShaderResources()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
#ifdef DEBUG_CAMERAS
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -312,7 +307,7 @@ HRESULT CCamera_Cinematic::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
return S_OK;
|
||||
|
||||
}
|
||||
@@ -506,10 +501,10 @@ CGameObject* CCamera_Cinematic::Clone(void* pArg, CGameObject* pOwner)
|
||||
void CCamera_Cinematic::Free()
|
||||
{
|
||||
__super::Free();
|
||||
#ifdef _DEBUG
|
||||
#ifdef DEBUG_CAMERAS
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
SAFE_RELEASE(m_pWORLD_LOCK_TargetPart);
|
||||
SAFE_RELEASE(m_pLookTargetPart);
|
||||
SAFE_RELEASE(m_pFollowTargetPart);
|
||||
|
||||
@@ -60,6 +60,10 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta)
|
||||
if (m_pGameInstance->Key_Pressing(DIK_TAB)) {
|
||||
Set_InitialPos();
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_8))
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(1007.23f, 2.f, 1015.5f, 1.f));
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) {
|
||||
if (m_pGameInstance->Key_Up(DIK_MINUS)) {
|
||||
CLayer* pLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_PLAYER);
|
||||
@@ -93,9 +97,11 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Debug::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
#ifdef DEBUG_CAMERAS
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
#endif // RELEASE_DEBUGGER
|
||||
}
|
||||
|
||||
void CCamera_Debug::Late_Update(_float fTimeDelta)
|
||||
@@ -183,11 +189,12 @@ void CCamera_Debug::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
|
||||
void CCamera_Debug::Describe_Entity()
|
||||
{
|
||||
_float3 vPosition = {};
|
||||
#ifdef _DEBUG
|
||||
GUI::Begin("PickingPos");
|
||||
if (m_pGameInstance->Key_Pressing(DIK_Y))
|
||||
{
|
||||
@@ -197,6 +204,7 @@ void CCamera_Debug::Describe_Entity()
|
||||
}
|
||||
}
|
||||
GUI::End();
|
||||
#endif // _DEBUG
|
||||
GUI::Begin("CAMERA");
|
||||
_int iPriority = m_iPriority;
|
||||
size_t iAddress = (size_t)this;
|
||||
@@ -214,4 +222,4 @@ void CCamera_Debug::Describe_Entity()
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
@@ -53,10 +53,6 @@ void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
Update_LerpTimer(fTimeDelta);
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
@@ -242,7 +238,7 @@ void CCamera_Gaze::Free()
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
|
||||
void CCamera_Gaze::Describe_Entity()
|
||||
{
|
||||
@@ -259,32 +255,31 @@ void CCamera_Gaze::Describe_Entity()
|
||||
m_fFovy = XMConvertToRadians(fFovYDegree);
|
||||
}
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::Text("LOOK_SRC %.2f, %.2f, %.2f", m_vLookPos_Src.x, m_vLookPos_Src.y, m_vLookPos_Src.z);
|
||||
GUI::Text("LOOK_DST %.2f, %.2f, %.2f", m_vLookPos_Dest.x, m_vLookPos_Dest.y, m_vLookPos_Dest.z);
|
||||
GUI::Text("FOLLOW_SRC %.2f, %.2f, %.2f", m_vFollowPos_Src.x, m_vFollowPos_Src.y, m_vFollowPos_Src.z);
|
||||
GUI::Text("FOLLOW_DST %.2f, %.2f, %.2f", m_vFollowPos_Dest.x, m_vFollowPos_Dest.y, m_vFollowPos_Dest.z);
|
||||
//GUI::Text("LOOK_SRC %.2f, %.2f, %.2f", m_vLookPos_Src.x, m_vLookPos_Src.y, m_vLookPos_Src.z);
|
||||
//GUI::Text("LOOK_DST %.2f, %.2f, %.2f", m_vLookPos_Dest.x, m_vLookPos_Dest.y, m_vLookPos_Dest.z);
|
||||
//GUI::Text("FOLLOW_SRC %.2f, %.2f, %.2f", m_vFollowPos_Src.x, m_vFollowPos_Src.y, m_vFollowPos_Src.z);
|
||||
//GUI::Text("FOLLOW_DST %.2f, %.2f, %.2f", m_vFollowPos_Dest.x, m_vFollowPos_Dest.y, m_vFollowPos_Dest.z);
|
||||
|
||||
GUI::DragFloat2("VerticalAngle", (_float*)&m_vAccRotDegree_VerticalLocks, 1.f, 0.f, 89.f);
|
||||
GUI::Checkbox("TransitionLerp", &m_bEnable_TransitionLerp);
|
||||
if (true == m_bEnable_TransitionLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vTransitionTime.x, m_vTransitionTime.y);
|
||||
GUI::SliderFloat("TranslationTime", &m_vTransitionTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
//GUI::DragFloat2("VerticalAngle", (_float*)&m_vAccRotDegree_VerticalLocks, 1.f, 0.f, 89.f);
|
||||
//GUI::Checkbox("TransitionLerp", &m_bEnable_TransitionLerp);
|
||||
//if (true == m_bEnable_TransitionLerp) {
|
||||
// GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vTransitionTime.x, m_vTransitionTime.y);
|
||||
// GUI::SliderFloat("TranslationTime", &m_vTransitionTime.y, 0.1f, 3.f, "%.1f");
|
||||
//}
|
||||
|
||||
GUI::Checkbox("LookLerp", &m_bEnable_LookLerp);
|
||||
if (true == m_bEnable_LookLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vLookLerpTime.x, m_vLookLerpTime.y);
|
||||
GUI::SliderFloat("LookTime", &m_vLookLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
|
||||
GUI::Checkbox("FollowLerp", &m_bEnable_FollowLerp);
|
||||
if (true == m_bEnable_FollowLerp) {
|
||||
GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vFollowLerpTime.x, m_vFollowLerpTime.y);
|
||||
GUI::SliderFloat("FollowTime", &m_vFollowLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
}
|
||||
//GUI::Checkbox("LookLerp", &m_bEnable_LookLerp);
|
||||
//if (true == m_bEnable_LookLerp) {
|
||||
// GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vLookLerpTime.x, m_vLookLerpTime.y);
|
||||
// GUI::SliderFloat("LookTime", &m_vLookLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
//}
|
||||
|
||||
//GUI::Checkbox("FollowLerp", &m_bEnable_FollowLerp);
|
||||
//if (true == m_bEnable_FollowLerp) {
|
||||
// GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vFollowLerpTime.x, m_vFollowLerpTime.y);
|
||||
// GUI::SliderFloat("FollowTime", &m_vFollowLerpTime.y, 0.1f, 3.f, "%.1f");
|
||||
//}
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
@@ -17,11 +17,11 @@ CCamera_Model::CCamera_Model(const CCamera_Model& rhs)
|
||||
|
||||
void CCamera_Model::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
_float3 vCamPos = {};
|
||||
_float3 vCamMomentum = {};
|
||||
XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
XMStoreFloat3(&vCamMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat3(&vCamMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
#ifdef _DEBUG
|
||||
GUI::Text("Cam_Model Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z);
|
||||
GUI::Text("v %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z);
|
||||
|
||||
@@ -154,7 +154,7 @@ void CDialogue_Panel::Change_Map()
|
||||
if (FAILED(m_pInfoInstance->Load_EffectParts("Bon_Fire_Data", "../Bin/Resources/Data/Effect/MapEffect/Bon_Fire")))
|
||||
return;
|
||||
|
||||
CLayer* pDuelistLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_DUELIST);
|
||||
/*CLayer* pDuelistLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_DUELIST);
|
||||
if (nullptr != pDuelistLayer) {
|
||||
CHuman_Duelist* pDuelist = pDuelistLayer->Get_Object<CHuman_Duelist>();
|
||||
pDuelist->Get_Component<CCharacter_Controller>()->Set_Position(XMVectorSet(1007.23f, 2.f, 1015.5f, 1.f));
|
||||
@@ -209,10 +209,10 @@ void CDialogue_Panel::Change_Map()
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//m_pGameInstance->Sound_StopChannel(SD_CHANNEL_GROUP::BGM);
|
||||
m_pGameInstance->Sound_Play(SOUND::SD_KIND::BGM_INSIDE, SD_CHANNEL_GROUP::BGM, true, 0.6f);
|
||||
//m_pGameInstance->Sound_Play(SOUND::SD_KIND::BGM_INSIDE, SD_CHANNEL_GROUP::BGM, true, 0.6f);
|
||||
//m_pGameInstance->Sound_Play(SOUND::SD_KIND::BGM_HOGWART_INT, SD_CHANNEL_GROUP::BGM, true, 1.2f);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ HRESULT CEffectParts::Initialize(void* pArg)
|
||||
void CEffectParts::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_EffectInfo.isMotionBlur == true)
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
}
|
||||
|
||||
void CEffectParts::Update(_float fTimeDelta)
|
||||
|
||||
@@ -57,7 +57,7 @@ HRESULT CElf::Initialize(void* pArg)
|
||||
|
||||
void CElf::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_iEntered -= 1;
|
||||
if (m_iEntered < 0) {
|
||||
m_iEntered = 0;
|
||||
@@ -507,7 +507,7 @@ HRESULT CElf::Ready_Components(void* pArg)
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
|
||||
Desc.bAutoOwnerTranslation = false;
|
||||
Desc.bAutoTranslation = false;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -580,7 +580,7 @@ void CElf::Describe_Entity()
|
||||
}
|
||||
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
|
||||
if (GUI::Button("Move To Player"))
|
||||
|
||||
@@ -680,7 +680,7 @@ void CGoblin::Describe_Entity()
|
||||
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
|
||||
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
|
||||
_float3 Pos;
|
||||
|
||||
@@ -98,11 +98,6 @@ void CGoblin_Assassin::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CGoblin_Assassin::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_Y))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::SLASH);
|
||||
}
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
@@ -785,7 +780,7 @@ void CGoblin_Assassin::Describe_Entity()
|
||||
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
|
||||
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
|
||||
_float3 Pos;
|
||||
|
||||
@@ -37,6 +37,7 @@ HRESULT CGoblin_Assassin::Behavior_IdleExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
|
||||
|
||||
if (m_fTargetDistance <= 20.f && m_fTargetDistance > 10.f)
|
||||
{
|
||||
m_bLookAt = false;
|
||||
@@ -374,7 +375,7 @@ HRESULT CGoblin_Assassin::Behavior_DashExitCheck(_float fTimeDelta)
|
||||
_float4 RootMomentum = m_pModelCom->Get_RootBoneMomentum();
|
||||
_vector RootDelta = XMLoadFloat4(&RootMomentum);
|
||||
_float dashDist = XMVectorGetX(XMVector3Length(RootDelta));
|
||||
m_pTransformCom->AccumulateMomentum(XMLoadFloat4(&m_vDashDir) * dashDist * 1.5f);
|
||||
m_pTransformCom->AccumulateVelocity(XMLoadFloat4(&m_vDashDir) * dashDist * 1.5f);
|
||||
|
||||
if (fRatio >= 0.7f)
|
||||
{
|
||||
@@ -973,7 +974,7 @@ void CGoblin_Assassin::HitState_Behavior(_float fTimeDelta)
|
||||
_float ease = 1.f - (t * t);
|
||||
_vector Force = vPlayerLook * fTimeDelta * 6.f * ease;
|
||||
|
||||
m_pTransformCom->AccumulateMomentum(Force);
|
||||
m_pTransformCom->AccumulateVelocity(Force);
|
||||
pairAnimInfo = m_Animation[STATEANIM::TUMBLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ void CGoblin_BattleAxe::Priority_Update(_float fTimeDelta)
|
||||
XMStoreFloat4(&m_vStartGripPos, Get_WorldPostion());
|
||||
}
|
||||
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
_matrix socketMatrix = {};
|
||||
|
||||
@@ -106,7 +107,10 @@ HRESULT CGoblin_BattleAxe::Render()
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_float Intensity = 1.f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -144,6 +148,10 @@ HRESULT CGoblin_BattleAxe::Render()
|
||||
m_pGripShape->Draw(m_pTransformCom->Get_XMWorldMatrix(), m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW), m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ), DirectX::Colors::Green, nullptr, true);
|
||||
m_pSubShape->Draw(XMLoadFloat4x4(&m_vAxeMat), m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW), m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ), DirectX::Colors::Purple, nullptr, true);
|
||||
#endif // _DEBUG
|
||||
Intensity = 0.f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ HRESULT CGoblin_Dagger::Initialize(void* pArg)
|
||||
|
||||
void CGoblin_Dagger::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
if (m_bAttach)
|
||||
@@ -89,7 +90,10 @@ HRESULT CGoblin_Dagger::Render()
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_float Intensity = 1.f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
@@ -98,7 +102,7 @@ HRESULT CGoblin_Dagger::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -106,7 +110,10 @@ HRESULT CGoblin_Dagger::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
Intensity = 0.f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,6 +106,11 @@ void CGoblin_Mage::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_Y))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
@@ -558,7 +563,7 @@ void CGoblin_Mage::Describe_Entity()
|
||||
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
|
||||
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
|
||||
_float3 Pos;
|
||||
|
||||
@@ -859,7 +859,7 @@ void CGoblin_Mage::HitState_Behavior(_float fTimeDelta)
|
||||
_float ease = 1.f - (t * t);
|
||||
_vector Force = vPlayerLook * fTimeDelta * 6.f * ease;
|
||||
|
||||
m_pTransformCom->AccumulateMomentum(Force);
|
||||
m_pTransformCom->AccumulateVelocity(Force);
|
||||
pairAnimInfo = m_Animation[STATEANIM::TUMBLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f);
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
|
||||
vDistance = XMVector4Normalize(vDistance);
|
||||
_float step = dist - fDesiredRange;
|
||||
|
||||
m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 2.f);
|
||||
m_pTransformCom->AccumulateVelocity(vDistance * step * fTimeDelta * 2.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -938,7 +938,7 @@ void CGoblin::HitState_Behavior(_float fTimeDelta)
|
||||
_float ease = 1.f - (t * t);
|
||||
_vector Force = vPlayerLook * fTimeDelta * 6.f * ease;
|
||||
|
||||
m_pTransformCom->AccumulateMomentum(Force);
|
||||
m_pTransformCom->AccumulateVelocity(Force);
|
||||
pairAnimInfo = m_Animation[STATEANIM::TUMBLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ HRESULT CGoblin_Sword::Initialize(void* pArg)
|
||||
|
||||
void CGoblin_Sword::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
@@ -95,7 +96,11 @@ HRESULT CGoblin_Sword::Render()
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
_float Intensity = 1.f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Render_Disolve())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -124,6 +129,10 @@ HRESULT CGoblin_Sword::Render()
|
||||
m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float));
|
||||
}
|
||||
|
||||
Intensity = 0.f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMBIntensity", &Intensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ HRESULT CHuman_Duelist::Initialize(void* pArg)
|
||||
|
||||
void CHuman_Duelist::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
@@ -641,7 +641,7 @@ void CHuman_Duelist::Describe_Entity()
|
||||
}
|
||||
m_pCharacter_Controller->Describe_Entity();
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
_char label[256];
|
||||
for (auto& iter : m_KeyFrames)
|
||||
|
||||
@@ -31,7 +31,7 @@ void CInfoInstance::Update(_float fTimeDelta)
|
||||
m_pInteractiveInfo->Update(fTimeDelta);
|
||||
m_pEffectInfo->Update(fTimeDelta);
|
||||
m_pCutSceneInfo->Update(fTimeDelta);
|
||||
}
|
||||
}
|
||||
|
||||
void CInfoInstance::Change_Level()
|
||||
{
|
||||
@@ -41,7 +41,6 @@ void CInfoInstance::Change_Level()
|
||||
m_pSkillInfo->Change_Level();
|
||||
m_pInteractiveInfo->Change_Level();
|
||||
m_pEffectInfo->Change_Level();
|
||||
// UI_Event.clear();
|
||||
m_pCutSceneInfo->Clear_AllEvents();
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ HRESULT CItem_Potion::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -140,8 +140,6 @@ HRESULT CItem_Potion::Render()
|
||||
#ifdef _DEBUG
|
||||
m_pRigidBody->Render();
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ HRESULT CLevel_Field::Ready_Camera()
|
||||
Camera_Desc.pCameraKey = CAMERA_DEBUG;
|
||||
Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
Camera_Desc.fMouseSensor = 0.1f;
|
||||
Camera_Desc.iPriority = 53;
|
||||
Camera_Desc.iPriority = 52;
|
||||
Camera_Desc.pFollowTarget = { nullptr };
|
||||
Camera_Desc.pLookTarget = { nullptr };
|
||||
|
||||
@@ -246,7 +246,7 @@ HRESULT CLevel_Field::Ready_Camera()
|
||||
Camera_Desc.fNear = 0.1f;
|
||||
Camera_Desc.fFar = 500.f;
|
||||
Camera_Desc.pCameraKey = CAMERA_CINEMATIC;
|
||||
Camera_Desc.iPriority = 52;
|
||||
Camera_Desc.iPriority = 53;
|
||||
Camera_Desc.bEnableTransitionLerp = false;
|
||||
Camera_Desc.bEnableLookLerp = false;
|
||||
Camera_Desc.bEnableFollowLerp = false;
|
||||
|
||||
@@ -166,40 +166,6 @@ HRESULT CLevel_GamePlay::Initialize()
|
||||
|
||||
void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
{
|
||||
_bool bStartCinematic = { true };
|
||||
#ifdef _DEBUG
|
||||
#ifdef 기무리
|
||||
bStartCinematic = false;
|
||||
#elif 진우
|
||||
bStartCinematic = true;
|
||||
#elif Bin
|
||||
bStartCinematic = false;
|
||||
#elif gimch
|
||||
bStartCinematic = true;
|
||||
#elif 나
|
||||
bStartCinematic = false;
|
||||
#endif
|
||||
#endif // _DEBUG
|
||||
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
if (m_pGameInstance->Key_Down(DIK_F5)) {
|
||||
m_pGameInstance->Toggle_RenderCollider();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bStartCinematic && false == m_bIntroCinematic) {
|
||||
m_bIntroCinematic = true;
|
||||
bStartCinematic = false;
|
||||
_string strCutSceneName = "CarriageIntro";
|
||||
m_pInfoInstance->Active_Event(strCutSceneName);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_0)) {
|
||||
if (m_pGameInstance->Key_Up(DIK_1))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
@@ -208,7 +174,9 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
UI_STATE eState = UI_STATE::LEVELCHANGE;
|
||||
m_pInfoInstance->Event_CallBack(TEXT("Canvas_Change"), &eState);
|
||||
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(
|
||||
CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)
|
||||
))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -369,9 +337,9 @@ HRESULT CLevel_GamePlay::Ready_Background()
|
||||
isReady_Hogwart = false;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isReady_Background = false;
|
||||
isReady_Hogsmeade = false;
|
||||
isReady_Hogwart = false;
|
||||
isReady_Background = true;
|
||||
isReady_Hogsmeade = true;
|
||||
isReady_Hogwart = true;
|
||||
#endif //
|
||||
#ifdef 나
|
||||
isReady_Background = false;
|
||||
|
||||
@@ -580,10 +580,10 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
isLoad_UI_SEQUANTIAL = false;
|
||||
#endif //
|
||||
#ifdef 기무리
|
||||
isLoad_Background = false;
|
||||
isLoad_Hogwart = false;
|
||||
isLoad_UI_SEQUANTIAL = false;
|
||||
isLoad_NPC = false;
|
||||
isLoad_Background = true;
|
||||
isLoad_Hogwart = true;
|
||||
isLoad_UI_SEQUANTIAL = true;
|
||||
isLoad_NPC = true;
|
||||
isLoad_Monster = true;
|
||||
#endif //
|
||||
#ifdef 나
|
||||
|
||||
@@ -68,8 +68,8 @@ void CMainApp::Update(_float fTimeDelta)
|
||||
ImGui_ImplDX11_NewFrame();
|
||||
ImGui_ImplWin32_NewFrame();
|
||||
GUI::NewFrame();
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Present_TimeCost();
|
||||
#ifdef _DEBUG
|
||||
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
|
||||
GUI::SliderFloat("fTimeMult", &g_fTimeMult, 0.01f, 4.f);
|
||||
|
||||
@@ -236,7 +236,7 @@ HRESULT CMapElement_Chest::Ready_Components(void* pArg)
|
||||
// RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX);
|
||||
Desc.bAutoOwnerTranslation = true;
|
||||
Desc.bAutoTranslation = true;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HIDDEN_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg)
|
||||
{ // RIGID_BODY
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR);
|
||||
Desc.bAutoOwnerTranslation = false;
|
||||
Desc.bAutoTranslation = false;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ void CMapObject_Render::Late_Update(_float fTimeDelta)
|
||||
m_iNumMeshe = m_pModelComs[m_iLodIndex]->Get_NumMeshes();
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
|
||||
}
|
||||
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Render()
|
||||
|
||||
@@ -34,7 +34,7 @@ HRESULT CMonster::Initialize(void* pArg)
|
||||
|
||||
void CMonster::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -50,12 +50,6 @@ void CMonster::Update(_float fTimeDelta)
|
||||
m_fTargetDistance = { FLT_MAX };
|
||||
}
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMonster::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
|
||||
_vector vDir = XMLoadFloat4(&m_vTargetPos) - Get_WorldPostion();
|
||||
vDir = XMVector4Normalize(vDir);
|
||||
@@ -70,6 +64,14 @@ void CMonster::Late_Update(_float fTimeDelta)
|
||||
m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir));
|
||||
}
|
||||
|
||||
void CMonster::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
HRESULT CMonster::Render_DeadDisolve()
|
||||
{
|
||||
if (FLT_EPSILON3 * 10 < m_fDeadRatio) {
|
||||
|
||||
@@ -51,7 +51,7 @@ HRESULT CNPC_EleazarFig::Initialize(void* pArg)
|
||||
|
||||
void CNPC_EleazarFig::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_iEntered -= 1;
|
||||
if (m_iEntered < 0) {
|
||||
m_iEntered = 0;
|
||||
@@ -304,7 +304,7 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg)
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::ELEAZARFIG);
|
||||
Desc.bAutoOwnerTranslation = false;
|
||||
Desc.bAutoTranslation = false;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ CNPC_Ollivander::CNPC_Ollivander(const CNPC_Ollivander& Prototype)
|
||||
|
||||
void CNPC_Ollivander::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_iEntered -= 1;
|
||||
if (m_iEntered < 0) {
|
||||
m_iEntered = 0;
|
||||
@@ -314,7 +314,7 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg)
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
|
||||
Desc.bAutoOwnerTranslation = false;
|
||||
Desc.bAutoTranslation = false;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ HRESULT CPhysXEffectHitBox::Initialize(void* pArg)
|
||||
|
||||
void CPhysXEffectHitBox::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos));
|
||||
m_pTransformCom->AccumulateVelocity(XMLoadFloat3(&m_vDeltaPos));
|
||||
}
|
||||
|
||||
void CPhysXEffectHitBox::Late_Update(_float fTimeDelta)
|
||||
@@ -49,6 +49,7 @@ void CPhysXEffectHitBox::Late_Update(_float fTimeDelta)
|
||||
if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius()));
|
||||
}
|
||||
|
||||
HRESULT CPhysXEffectHitBox::Render()
|
||||
|
||||
@@ -141,7 +141,7 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
ReLockOnTarget();
|
||||
SetGravity();
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
@@ -152,7 +152,19 @@ void CPlayer::Update(_float fTimeDelta)
|
||||
Update_CameraCoordinateSystem(fTimeDelta);
|
||||
UpdateGrapInteractive(fTimeDelta);
|
||||
Update_RaycastElements();
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
if (m_pGameInstance->Key_Up(DIK_9))
|
||||
{
|
||||
m_bFSMUpdate = !m_bFSMUpdate;
|
||||
}
|
||||
if (m_bFSMUpdate) {
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
}
|
||||
|
||||
//ImGui::SetWindowFontScale(2.0f);
|
||||
//ImGui::Text("STATE : %s", m_pFSM->Get_CurrentStateName());
|
||||
//ImGui::SetWindowFontScale(1.0f);
|
||||
|
||||
|
||||
|
||||
Play_SpellHitAnim();
|
||||
|
||||
@@ -564,7 +576,7 @@ void CPlayer::Trigger(CTimeSocket& Socket)
|
||||
m_pTransformCom->Set_State(STATE::POSITION, vNewPos);
|
||||
m_pCharacter_Controller->Set_Position(vNewPos);
|
||||
m_pTransformCom->RotationQ(pContents->pxTransform.q);
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
} break;
|
||||
case TIMESOCKET_FUNC::TRANSLATION_LERP:
|
||||
{
|
||||
@@ -1013,7 +1025,7 @@ vector<_float> CPlayer::GetFootStepTiming(_uint AnimIndex)
|
||||
{
|
||||
{
|
||||
if (AnimIndex == m_Animation[STATEANIM::WALK_FWD].first)
|
||||
return { 0.15f, 0.65f };
|
||||
return { 0.1f,0.25f,0.42f, 0.59f ,0.75f,0.92f};
|
||||
|
||||
if (AnimIndex == m_Animation[STATEANIM::JOG_FWD].first)
|
||||
return { 0.01f, 0.17f, 0.33f,0.49f,0.66f,0.84f };
|
||||
@@ -1184,7 +1196,7 @@ void CPlayer::Describe_Entity()
|
||||
m_pCharacter_Controller->Describe_Entity();
|
||||
GUI::Checkbox("Battle", &m_bDuel_ZOnlyMove);
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
_char label[256];
|
||||
for (auto& iter : m_KeyFrames)
|
||||
|
||||
@@ -227,9 +227,13 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta)
|
||||
else if (SUCCEEDED(InputSpell())) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
#ifndef DEBUG_SHADOW
|
||||
#ifndef DEBUG_CAMERAS
|
||||
else if (m_pGameInstance->Mouse_Down(DIM_LBUTTON)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
#endif // !DEBUG_CAMERAS
|
||||
#endif // !DEBUG_SHADOW
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
@@ -592,7 +596,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta)
|
||||
}
|
||||
_vector vLook = m_pTransformCom->Get_State(STATE::LOOK);
|
||||
vLook = XMVector3Normalize(vLook);
|
||||
m_pTransformCom->AccumulateMomentum(vLook *fTimeDelta *0.8f);
|
||||
m_pTransformCom->AccumulateVelocity(vLook *fTimeDelta *0.8f);
|
||||
}
|
||||
else if (SUCCEEDED(InputMove())) {
|
||||
m_fMoveTime += fTimeDelta;
|
||||
@@ -808,6 +812,7 @@ void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
m_pFSM->Enable_State(FSMSTATE::LAND);
|
||||
_float fRatio = 0.11f;
|
||||
Get_PartObject<CWand>()->Set_Visible(false);
|
||||
_int iCurrAnim = m_pModelCom->Get_AnimIndex();
|
||||
if (iCurrAnim == m_Animation[STATEANIM::JUMP].first)
|
||||
@@ -817,15 +822,20 @@ void CPlayer::Behavior_LandEnter()
|
||||
else if (iCurrAnim == m_Animation[STATEANIM::JUMP_SPRINT].first)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::LAND_TO_SPRINT];
|
||||
fRatio = 0.18f;
|
||||
}
|
||||
else if (iCurrAnim == m_Animation[STATEANIM::JUMP_JOG].first)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::LAND_TO_JOG];
|
||||
fRatio = 0.18f;
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::LAND];
|
||||
}
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {
|
||||
m_pGameInstance->Sound_Play(SOUND::SD_KIND::GOBLIN_LAND, SD_CHANNEL_GROUP::ENEMY, false, 0.1f); },
|
||||
fRatio);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ void CRandomNpc::Priority_Update(_float fTimeDelta)
|
||||
if (!m_pGameInstance->IsIn_WorldFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())) {
|
||||
return;
|
||||
}
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_iEntered -= 1;
|
||||
if (m_iEntered < 0) {
|
||||
m_iEntered = 0;
|
||||
@@ -448,7 +448,7 @@ HRESULT CRandomNpc::Ready_Components(void* pArg)
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER);
|
||||
Desc.bAutoOwnerTranslation = false;
|
||||
Desc.bAutoTranslation = false;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -787,7 +787,7 @@ HRESULT CRanrok::Ready_SubParts()
|
||||
m_pRanrokCombinedBoneMatrices[ENUM_CLASS(RANROK_ENUM_BONEMATRICES::TAIL2)] = m_pTail2_BoneMat = m_pModelCom->Get_BoneMatrixPtr("tail_12");
|
||||
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.bAutoOwnerTranslation = false;
|
||||
Desc.bAutoTranslation = false;
|
||||
Desc.iSubKind = ENUM_CLASS(PXOBJECT::RANROK_BODY);
|
||||
for (_uint i = 0; i < ENUM_CLASS(RANROK_ENUM_BONEMATRICES::END); ++i) {
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_RANROK_BODY"), (CComponent**)&m_pTargetableDO[i], &Desc))) {
|
||||
|
||||
@@ -803,7 +803,7 @@ HRESULT CRanrok::Behavior_RushExitCheck(_float fTimeDelta)
|
||||
vLook = XMVector3Normalize(vLook);
|
||||
_vector vPos = m_pCharacter_Controller->Get_Position();
|
||||
_vector vNextPos = vPos + vLook * 10.f * fTimeDelta;
|
||||
m_pTransformCom->AccumulateMomentum(vLook * 10.f * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(vLook * 10.f * fTimeDelta);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ HRESULT CTerrain::Initialize(void* pArg)
|
||||
|
||||
void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
}
|
||||
|
||||
void CTerrain::Update(_float fTimeDelta)
|
||||
|
||||
@@ -32,15 +32,15 @@ HRESULT CTriggerBox::TryScanArea(_float fTimeDelta)
|
||||
HRESULT CTriggerBox::Render()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_Batch->Begin();
|
||||
//m_Batch->Begin();
|
||||
|
||||
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0f0f, CMyTools::Saturate(m_vScanTimer.x / m_vScanTimer.y + 0.1f));
|
||||
m_pSubShape->Draw(m_pTransformCom->Get_XMWorldMatrix(), ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
//_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
|
||||
//_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
|
||||
//_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0f0f, CMyTools::Saturate(m_vScanTimer.x / m_vScanTimer.y + 0.1f));
|
||||
//m_pSubShape->Draw(m_pTransformCom->Get_XMWorldMatrix(), ViewMatrix, ProjMatrix, vColor, nullptr, true);
|
||||
|
||||
m_Batch->End();
|
||||
m_bRender = false;
|
||||
//m_Batch->End();
|
||||
//m_bRender = false;
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -45,7 +45,6 @@ HRESULT CTroll_Rock::Initialize(void* pArg)
|
||||
|
||||
void CTroll_Rock::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
if (m_bAttach)
|
||||
@@ -206,7 +205,7 @@ HRESULT CTroll_Rock::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -248,15 +247,6 @@ HRESULT CTroll_Rock::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -178,26 +178,37 @@ void CTroll::Behavior_IdleBreakEnter()
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_fDegree < 150.f)
|
||||
if (m_fDegree <= 45.f)
|
||||
{
|
||||
m_bLookAt = false;
|
||||
if (m_fCross < 0.f)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_90_L];
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_90_R];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 1.f);
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_45_L];
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_45_R];
|
||||
}
|
||||
else {
|
||||
else if (m_fDegree <= 90.f)
|
||||
{
|
||||
m_bLookAt = false;
|
||||
if (m_fCross < 0.f)
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_90_L];
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_90_R];
|
||||
}
|
||||
else if (m_fDegree <= 135.f)
|
||||
{
|
||||
m_bLookAt = false;
|
||||
if (m_fCross < 0.f)
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_135_L];
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_135_R];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bLookAt = false;
|
||||
if (m_fCross < 0.f)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L];
|
||||
}
|
||||
else {
|
||||
else
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R];
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,6 +240,7 @@ HRESULT CTroll::Behavior_IdleBreakExitCheck()
|
||||
void CTroll::Behavior_IdleBreakExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLEBREAK);
|
||||
m_bLookAt = true;
|
||||
}
|
||||
|
||||
void CTroll::Behavior_MoveEnter()
|
||||
@@ -359,17 +371,17 @@ HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] <= 0.f))
|
||||
if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] <= 0.f) && m_fDegree <=30.f)
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::SLAM);
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] <= 0.f))
|
||||
else if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] <= 0.f) && m_fDegree <= 30.f)
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::BACKHAND_SWING);
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] <= 0.f))
|
||||
else if (m_fTargetDistance <= 6.f && (m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] <= 0.f) && m_fDegree <= 30.f)
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::SWING);
|
||||
return E_FAIL;
|
||||
@@ -472,9 +484,9 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta)
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
/*Add_Event(pairAnimInfo.first,
|
||||
[this]() {m_bLookAt = true; },
|
||||
0.3f);
|
||||
0.3f);*/
|
||||
|
||||
Add_Sound_Event(pairAnimInfo.first,
|
||||
[this]() {_int iRand = m_pGameInstance->Real_Random_Int(0, 2);
|
||||
@@ -496,7 +508,6 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta)
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
m_bLookAt = true;
|
||||
m_pFSM->Change_State(FSMSTATE::IDLEBREAK);
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -816,11 +827,6 @@ void CTroll::Behavior_StunEnter()
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() { m_bLookAt = true;
|
||||
},
|
||||
0.6f);
|
||||
|
||||
if (m_pRushEffect != nullptr)
|
||||
{
|
||||
m_pRushEffect->Get_PartObject<CEffectParts>()->Get_Component<CInstance_Model>()->Set_Loop(false);
|
||||
@@ -843,6 +849,8 @@ HRESULT CTroll::Behavior_StunExitCheck(_float fTimeDelta)
|
||||
void CTroll::Behavior_StunExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::STUN);
|
||||
|
||||
m_bLookAt = true;
|
||||
}
|
||||
|
||||
void CTroll::Behavior_HitEnter()
|
||||
|
||||
@@ -55,6 +55,7 @@ HRESULT CTroll_Weapon::Initialize(void* pArg)
|
||||
|
||||
void CTroll_Weapon::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
_matrix socketMatrix = {};
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ HRESULT CWand::Initialize(void* pArg)
|
||||
|
||||
void CWand::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
|
||||
@@ -54,6 +54,9 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
_float2 m_vAccRealDegrees = { 0.f, 0.f };
|
||||
_float3 m_vShoulderLocalPos = { 1.f, 2.f, 2.f };
|
||||
_bool m_bPlayAnim = { false };
|
||||
_bool m_bDebugMove = false;
|
||||
_bool m_bFreeze = false;
|
||||
|
||||
#pragma endregion
|
||||
#pragma region Lerp
|
||||
_bool m_bStartGame = { true };
|
||||
@@ -96,15 +99,20 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
CCamPosition_Target* m_pTarget_FollowPart = { nullptr };
|
||||
class CCamera_Gaze* m_pBinded_Camera = { nullptr };
|
||||
class CModel* m_pModelCom = { nullptr };
|
||||
|
||||
#ifdef DEBUG_CAMERAS
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch = { nullptr };
|
||||
_bool m_bRenderHeadPos = { false };
|
||||
_bool m_bRenderLookPos = { false };
|
||||
#endif // DEBUG_CAMERAS
|
||||
public:
|
||||
static CCamPosition_Shoulder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Shoulder* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
void Describe_Entity();
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -91,12 +91,12 @@ class CCamera_Cinematic final : public CCamera
|
||||
_float2 m_vCameraShakeTimer = { 0.f, TIMER_SHORT_LERP };
|
||||
_float m_fCameraShakeTime = TIMER_SHORT_LERP;
|
||||
_float m_fCameraShakeIntense = 5.f;
|
||||
#ifdef _DEBUG
|
||||
#ifdef DEBUG_CAMERAS
|
||||
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
|
||||
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch = { nullptr };
|
||||
class CModel* m_pModelCom = { nullptr };
|
||||
class CShader* m_pShaderCom = { nullptr };
|
||||
#endif // _DEBUG
|
||||
#endif // DEBUG_CAMERAS
|
||||
|
||||
public:
|
||||
static CCamera_Cinematic* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -40,9 +40,9 @@ class CCamera_Debug final : public CCamera
|
||||
static CCamera_Debug* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
void Describe_Entity();
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@ class CCamera_Gaze final : public CCamera
|
||||
virtual void Free() override;
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
void Describe_Entity();
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif // RELEASE_DEBUGGER
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -210,6 +210,7 @@ class CPlayer final : public CUnit
|
||||
_uint m_iPrevAnimIndex = 0;
|
||||
|
||||
_bool m_bOnGroundHit = {};
|
||||
_bool m_bFSMUpdate = {true};
|
||||
|
||||
/* 무적 불 변수*/
|
||||
#ifdef _DEBUG
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
<Anim state="IDLE" index="16" loop="true"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_BWD_R" index="118" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_BWD_L" index="114" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_45_L" index="115" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_45_R" index="119" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_90_L" index="116" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_90_R" index="120" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_135_L" index="113" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_TURN_135_R" index="117" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_RUSH_TURN_BWD_R" index="7" loop="false"/>
|
||||
<Anim state="IDLE_COMBAT_RUSH_TURN_BWD_L" index="8" loop="false"/>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<Pos x="15.554" y="5.833" z="201.019"/>
|
||||
</Position>
|
||||
<Position>
|
||||
<Pos x="8.232" y="-12.972" z="202.142"/>
|
||||
<Pos x="8.232" y="-8.972" z="202.142"/>
|
||||
</Position>
|
||||
</Name>
|
||||
<Name Flow="2">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<StatInfo>
|
||||
<STAT_PLAYER Name="Aria" OBJECTID="-1" HP="100" MAXHP="100" TARGETHP="100" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="0"/>
|
||||
<STAT_GOBLIN Name="고블린 전사" OBJECTID="0" HP="100" MAXHP="100" TARGETHP="100" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="0"/>
|
||||
<STAT_GOBLIN_ASSASSIN Name="고블린 암살자" OBJECTID="1" HP="100" MAXHP="100" TARGETHP="100" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="0"/>
|
||||
<STAT_GOBLIN_ASSASSIN Name="고블린 암살자" OBJECTID="1" HP="10000" MAXHP="10000" TARGETHP="10000" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="0"/>
|
||||
<STAT_GOBLIN_WIZARD Name="고블린 마법사" OBJECTID="2" HP="100" MAXHP="100" TARGETHP="100" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="2" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="0"/>
|
||||
<STAT_TROLL Name="트롤" OBJECTID="3" HP="500" MAXHP="500" TARGETHP="500" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="5" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="1"/>
|
||||
<STAT_RANROK Name="란록" OBJECTID="4" HP="1000" MAXHP="1000" TARGETHP="1000" DAMAGE="10" DEFENSE="10" SPEED="10" LEVEL="5" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000" BOSS="1"/>
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
물체 위에 표시가 떳을 때 Z로 시전할 수 있습니다."
|
||||
Spell_Lock="0" Equip_Spell="0" Use_Skill="1" Preview="0" Vidio="0" />
|
||||
<Spell Spell_ID="31" Spell_Name="고대 마법" Image_Name="Ancient_Magic" Spell_Type="6" Type_Name="필수" Skill_Type="31"
|
||||
Spell_Damage="10" Spell_Cooltime="0" Duration="0" AnimNum="152"
|
||||
Spell_Damage="120" Spell_Cooltime="0" Duration="0" AnimNum="152"
|
||||
SpellInfo="고대 마법 MP가 한 부분이라도 가득 차 있으면, 엄청난
|
||||
대미지를 주고 방어벽 마버을 부수는 강력한 고대 마법을
|
||||
시전할 수 있게 됩니다. 적의 머리 위에 표시가
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<KeyFrames>
|
||||
<Animation Index="206">
|
||||
<KeyFrame Event="Player/Voice/avadakedavra_voice.wav" Ratio="0.265" Volume="0.8"/>
|
||||
</Animation>
|
||||
<Animation Index="0">
|
||||
<KeyFrame Event="Player/spells_avada_kedavra_akb/avada_kedavra_7.wav" Ratio="0.01" Volume="0.69999999"/>
|
||||
<KeyFrame Event="Player/spells_avada_kedavra_akb/avada_kedavra_6.wav" Ratio="0.01" Volume="0.69999999"/>
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
@@ -137,22 +137,8 @@ float2 UV_Cutting(float2 vUV, float2 vUVCutting, uint iCurrentFrame)
|
||||
//}
|
||||
|
||||
|
||||
// (Kd F(Lambert)) + (Ks F(cook-torrance))
|
||||
|
||||
//float LambertDiffuse(float c)
|
||||
//{
|
||||
// return c / PI;
|
||||
//}
|
||||
|
||||
// F(cook-torrance)
|
||||
// DFG / (4 (Wo dot N) (Wi dot N))
|
||||
|
||||
// D(distribution, NormalDistribution function), 표면의 거칠기에 영향을 받는 halfWay vector
|
||||
// G(Geometry, GeometryFunc), 에너지 보존법칙 적용
|
||||
// F(Fresnel-Fresnel equation), 표면 각도에 따른 반사율
|
||||
|
||||
// F->D
|
||||
float NDF_ggxtr(float3 vNormal, float3 vHalfWayVector, float fAlpha) // NormalDistributionGGXTR, (H, halfWay vector), (A, Roughness), (N, Normal)
|
||||
float NDF_ggxtr(float3 vNormal, float3 vHalfWayVector, float fAlpha)
|
||||
{
|
||||
float a2 = fAlpha * fAlpha;
|
||||
float NdotH = saturate(dot(vNormal, vHalfWayVector));
|
||||
@@ -166,28 +152,14 @@ float NDF_ggxtr(float3 vNormal, float3 vHalfWayVector, float fAlpha) // NormalDi
|
||||
}
|
||||
|
||||
// F->G
|
||||
// GschlickGGX(n, v, k)
|
||||
// k는 이하 두개 조명 조건에 따라 가변적임
|
||||
// Direct // Kdir -> ((a + 1) * (a + 1)) / 8 // direct lighting 추천
|
||||
// IBL Lighting // Kibl -> a * a / 2 // 이미지 기반 조명기법
|
||||
|
||||
float Geometry_SchlickGGX(float NdotV, float fK)
|
||||
float Geometry_SchlickGGX(float NdotV, float fk)
|
||||
{
|
||||
return NdotV / (NdotV * (1.0f - fK) + fK);
|
||||
return NdotV / (NdotV * (1.0f - fk) + fk);
|
||||
}
|
||||
|
||||
float Geometry_Smith(float3 vNormal, float3 vFromView, float3 vFromLight, float k)
|
||||
float Geometry_Smith(float3 vNormal, float NdotV, float NdotL, float fk)
|
||||
{
|
||||
// Geometry Obstruction
|
||||
// 철이 있는, 주로 튀어나온 장애물
|
||||
float NdotV = saturate(dot(vNormal, vFromView));
|
||||
|
||||
// Geometry Shadowing
|
||||
// 요가 있는, 주로 음푹 들어간 장애물 (그래서 셰도잉)
|
||||
float NdotL = saturate(dot(vNormal, vFromLight));
|
||||
|
||||
// 요철이 골고루 있다고 가정하고 적당히 섞음
|
||||
return Geometry_SchlickGGX(NdotV, k) * Geometry_SchlickGGX(NdotL, k);
|
||||
return Geometry_SchlickGGX(NdotV, fk) * Geometry_SchlickGGX(NdotL, fk);
|
||||
}
|
||||
|
||||
// F -> F
|
||||
@@ -217,16 +189,17 @@ PBR_LIGHT_OUT PBR_Lighting(
|
||||
return Out;
|
||||
}
|
||||
|
||||
float fAlpha = max(fRoughness * fRoughness, 0.04f);
|
||||
float k = ((fRoughness + 1.f) * (fRoughness + 1.f)) / 8.f;
|
||||
float r = max(fRoughness, 0.046);
|
||||
float fAlpha = r * r;
|
||||
float k = ((r + 1.f) * (r + 1.f)) / 8.f;
|
||||
|
||||
float D = NDF_ggxtr(vNormal, vHalfVector, fAlpha);
|
||||
float G = Geometry_Smith(vNormal, vToView, vToLight, k);
|
||||
float G = Geometry_Smith(vNormal, NdotV, NdotL, k);
|
||||
float3 F = Fresnel_Schlick(saturate(dot(vHalfVector, vToView)), vFO);
|
||||
|
||||
float3 vNumerator = D * G * F;
|
||||
float3 vNominator = D * G * F;
|
||||
float fDenominator = max(4.f * NdotL * NdotV, 1e-7);
|
||||
float3 specularBRDF = vNumerator / fDenominator;
|
||||
float3 specularBRDF = vNominator / fDenominator;
|
||||
|
||||
float3 kS = F;
|
||||
float3 kD = (1.f - kS) * (1.f -fMetallic);
|
||||
@@ -322,22 +295,28 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv)
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
// BackGround ForeGround 합은 1
|
||||
float2 DepthCompare(float fCenterDepth, float fSampleDepth, float fDepthScale)
|
||||
float2 ComputeDepthWeights(float fCenterDepth, float fSampleDepth, float fDepthScale)
|
||||
{
|
||||
return saturate(0.5f + float2(fDepthScale, -fDepthScale) * (fSampleDepth - fCenterDepth));
|
||||
}
|
||||
float delta = fSampleDepth - fCenterDepth;
|
||||
|
||||
float2 SpreadCompare(float fOffsetLength, float2 fSpreadLength, float fPixelToSampleUnitsScale)
|
||||
{
|
||||
return saturate(fPixelToSampleUnitsScale * fSpreadLength - fOffsetLength + 1.f);
|
||||
float fBackgroundWeight = saturate(0.5f + fDepthScale * delta);
|
||||
float fForegroundWeight = 1.0f - fBackgroundWeight;
|
||||
|
||||
return float2(fBackgroundWeight, fForegroundWeight);
|
||||
}
|
||||
|
||||
float SampleWeight(float fCenterDepth, float fSampleDepth, float fOffsetLength, float fCenterSpreadLength, float fSampleSpreadLength, float fPixelToSampleUnitsScale, float fDepthScale)
|
||||
float ComputeSpreadWeight(float fStepOffset, float fSpreadLength, float fVelocityScale)
|
||||
{
|
||||
float2 vDepthCompare = DepthCompare(fCenterDepth, fSampleDepth, fDepthScale);
|
||||
float2 vSpreadCompare = SpreadCompare(fOffsetLength, float2(fCenterSpreadLength, fSampleSpreadLength), fPixelToSampleUnitsScale);
|
||||
return dot(vDepthCompare, vSpreadCompare);
|
||||
return saturate(fVelocityScale * fSpreadLength - fStepOffset + 1.f);
|
||||
}
|
||||
float SampleWeight(float fCenterDepth, float fSampleDepth, float fStepOffset, float fCenterSpreadLength,
|
||||
float fSampleSpreadLength, float fVelocityScale, float fDepthScale)
|
||||
{
|
||||
float2 vDepthCompare = ComputeDepthWeights(fCenterDepth, fSampleDepth, fDepthScale);
|
||||
|
||||
float fCenter = ComputeSpreadWeight(fStepOffset, fCenterSpreadLength, fVelocityScale);
|
||||
float fSample = ComputeSpreadWeight(fStepOffset, fSampleSpreadLength, fVelocityScale);
|
||||
|
||||
return vDepthCompare.x * fCenter + vDepthCompare.y * fSample;
|
||||
}
|
||||
|
||||
float4x4 RotateX(float fAngle)
|
||||
@@ -481,7 +460,7 @@ float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
return fAmount * fRatio;
|
||||
}
|
||||
|
||||
float3 ReinHard_ToneMapper(float3 vColor)
|
||||
float3 Reinhard_ToneMapper(float3 vColor)
|
||||
{
|
||||
float k = 1.f;
|
||||
vColor = (vColor / (vColor + k));
|
||||
@@ -496,10 +475,8 @@ float3 Filmic_ToneMapper(float3 vColor)
|
||||
const float fD = 0.59f;
|
||||
const float fE = 0.14f;
|
||||
|
||||
vColor = saturate(
|
||||
vColor * (fA * vColor + fB)
|
||||
/ (vColor * (fC * vColor + fD) + fE)
|
||||
);
|
||||
vColor = saturate( vColor * (fA * vColor + fB)
|
||||
/ (vColor * (fC * vColor + fD) + fE) );
|
||||
|
||||
return vColor;
|
||||
}
|
||||
@@ -585,24 +562,26 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex
|
||||
float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f)
|
||||
{
|
||||
float2 vReturnVelocity = float2(0.5f, 0.5f);
|
||||
if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5)
|
||||
{
|
||||
if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) {
|
||||
return vReturnVelocity;
|
||||
}
|
||||
|
||||
{
|
||||
float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w;
|
||||
float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w;
|
||||
|
||||
float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w;
|
||||
float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w;
|
||||
currentNDC.y *= -1.f;
|
||||
previousNDC.y *= -1.f;
|
||||
|
||||
currentNDC.y *= -1.f;
|
||||
previousNDC.y *= -1.f;
|
||||
float2 velocityUV = (currentNDC - previousNDC) * 0.5f;
|
||||
velocityUV *= fIntensity;
|
||||
velocityUV = clamp(velocityUV, -1.0f, 1.0f);
|
||||
|
||||
// UV 델타
|
||||
float2 velocityUV = (currentNDC - previousNDC) * 0.5f;
|
||||
velocityUV *= fIntensity;
|
||||
velocityUV = clamp(velocityUV, -1.0f, 1.0f);
|
||||
|
||||
return velocityUV * 0.5f + 0.5f; // 0 속도 -> 0.5
|
||||
vReturnVelocity = velocityUV * 0.5f + 0.5f;
|
||||
}
|
||||
return vReturnVelocity;
|
||||
}
|
||||
|
||||
float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos)
|
||||
{
|
||||
return CalcVelocityUV(vCurrentProjPos, vPreviousProjPos, 1.0f);
|
||||
|
||||
@@ -48,7 +48,6 @@ sampler BorderZeroSampler = sampler_state
|
||||
AddressV = Border;
|
||||
BorderColor = float4(0.f, 0.f, 0.f, 0.f);
|
||||
};
|
||||
|
||||
sampler BorderZeroLinearSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
@@ -65,7 +64,7 @@ sampler BorderOneSampler = sampler_state
|
||||
BorderColor = float4(1.f, 1.f, 1.f, 1.f);
|
||||
};
|
||||
|
||||
sampler SsaoDataSampler = sampler_state
|
||||
sampler SSAODataSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_POINT;
|
||||
AddressU = wrap;
|
||||
|
||||
@@ -50,6 +50,7 @@ float g_fSpotOuterAngle;
|
||||
float g_fToneMappingExposure;
|
||||
uint g_iToneMappingType;
|
||||
bool g_bUsePowerLightAttenuation;
|
||||
bool g_bUsePhongShader;
|
||||
float g_fLightAttenuationPower;
|
||||
|
||||
vector g_vLightDir;
|
||||
@@ -100,6 +101,7 @@ vector g_vFogColor;
|
||||
float g_fDepthPackExponent;
|
||||
|
||||
Texture3D g_VolumeTexture;
|
||||
float g_fCascadeBlendRatio = 0.02f;
|
||||
|
||||
float g_fWeights_32[32] =
|
||||
{
|
||||
@@ -218,13 +220,13 @@ struct PS_OUT_BACKBUFFER
|
||||
};
|
||||
struct PS_OUT_DEBUG_MOTIONBLUR
|
||||
{
|
||||
float3 vBaseMotionBlur : SV_TARGET0;
|
||||
float3 vTentMotionBlur : SV_Target1;
|
||||
float4 vBaseMotionBlur : SV_TARGET0;
|
||||
float4 vTentMotionBlur : SV_Target1;
|
||||
};
|
||||
struct PS_OUT_LIGHT
|
||||
{
|
||||
vector vShade : SV_TARGET0;
|
||||
vector vSpecular : SV_TARGET1;
|
||||
float4 vShade : SV_TARGET0;
|
||||
float4 vSpecular : SV_TARGET1;
|
||||
};
|
||||
struct PS_OUT_FLT4_SINGLE
|
||||
{
|
||||
@@ -268,33 +270,34 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
|
||||
|
||||
float2 vCenterUV = In.vTexcoord;
|
||||
float2 vFullResolutionTexelSize = 1.f / g_vResolution;
|
||||
float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y;
|
||||
float2 vCenterVelo = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1
|
||||
float2 vCenterVeloPixel = vCenterVelo * g_vResolution.xy;
|
||||
bool bBorrowedVelocityFromTile = false;
|
||||
float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y * g_fFar;
|
||||
float2 vCenterVelocity = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1
|
||||
float2 vCenterVeloPixel = vCenterVelocity * g_vResolution.xy;
|
||||
bool bBorrowedVelocity = false;
|
||||
|
||||
float2 vBlurVelo = vCenterVelo;
|
||||
float2 vBlurVeloPixel = vCenterVeloPixel; // 프레임당 픽셀 이동량
|
||||
float2 vBlurVelocity = vCenterVelocity;
|
||||
float2 vBlurVelocityPixel = vCenterVelocity * g_vResolution.xy; // 프레임당 픽셀 이동량
|
||||
|
||||
float fVelocityEpsilon = 0.5f;
|
||||
|
||||
if (length(vBlurVeloPixel) < fVelocityEpsilon)
|
||||
if (length(vBlurVelocityPixel) < fVelocityEpsilon)
|
||||
{
|
||||
// 사실상 정지해 있던 픽셀이면 텐트벨로시티맵에서 빌려옴
|
||||
vBlurVelo = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f;
|
||||
vBlurVeloPixel = vBlurVelo * g_vResolution.xy;
|
||||
bBorrowedVelocityFromTile = true;
|
||||
vBlurVelocity = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f;
|
||||
vBlurVelocityPixel = vBlurVelocity * g_vResolution.xy;
|
||||
bBorrowedVelocity = true;
|
||||
}
|
||||
|
||||
if (length(vBlurVeloPixel) < fVelocityEpsilon) {
|
||||
if (length(vBlurVelocityPixel) < fVelocityEpsilon)
|
||||
{
|
||||
// 텐트벨로시티맵에서 빌려온 픽셀또한 정지해 있었으면 원본 그대로 반환
|
||||
Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV);
|
||||
Out.vVelocity = float2(0.5f, 0.5f);
|
||||
return Out;
|
||||
}
|
||||
float fPixelSpeed = length(vBlurVeloPixel);
|
||||
float fPixelSpeed = length(vBlurVelocityPixel);
|
||||
|
||||
float2 vBlurDirPixel = (vBlurVeloPixel / max(fPixelSpeed, FLT_EPSILON5));
|
||||
float2 vBlurDirPixel = (vBlurVelocityPixel / max(fPixelSpeed, FLT_EPSILON5));
|
||||
|
||||
// 픽셀의 속도로 블러 반경을 가변적으로 돌림
|
||||
float fBlurRadiusPixel = clamp(fPixelSpeed * 0.4f , 0.f, g_fMBMaxBlurRadius);
|
||||
@@ -307,39 +310,40 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
|
||||
float fSamplePixelSpeed = fBlurRadiusPixel / max((float) iMaxRadius, 1.f);
|
||||
|
||||
// 샘플유닛의 크기
|
||||
float fScalePixelToSampleUnit = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5);
|
||||
float fScaleDepth = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5);
|
||||
float fVelocityScale = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5);
|
||||
float fDepthScale = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5);
|
||||
float4 vAccColorSum = float4(0.f, 0.f, 0.f, 0.f);
|
||||
float2 vAccVeloSum = float2(0.f, 0.f);
|
||||
float fAccWeight = 0.f;
|
||||
|
||||
// 센터의 스프레드 길이
|
||||
float2 vReferenceVelocityPixel = bBorrowedVelocityFromTile ? vBlurVeloPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨
|
||||
float fCenterSpreadLengthPixel = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍
|
||||
float2 vReferenceVelocityPixel = bBorrowedVelocity ? vBlurVelocityPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨
|
||||
float fCurrentVelocityVector = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍
|
||||
|
||||
[loop]
|
||||
for (int iInterval = -iMaxRadius; iInterval <= iMaxRadius; ++iInterval) {
|
||||
float fOffset = (float) abs(iInterval);
|
||||
float2 vOffsetPixel = vBlurDirPixel * ((float) iInterval * fSamplePixelSpeed);
|
||||
for (int iStep = -iMaxRadius; iStep <= iMaxRadius; ++iStep)
|
||||
{
|
||||
float fOffset = (float) abs(iStep);
|
||||
float2 vOffsetPixel = vBlurDirPixel * ((float) iStep * fSamplePixelSpeed);
|
||||
float2 vSamplingUV = vCenterUV + vOffsetPixel * vFullResolutionTexelSize;
|
||||
if (false == IsValidUV(vSamplingUV)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
float fSampledDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y;
|
||||
float2 vSampledVelo = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f;
|
||||
float2 vSampledVeloPixel = vSampledVelo * g_vResolution.xy;
|
||||
float fSampleDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y * g_fFar;
|
||||
float2 vSampledVelocity = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f;
|
||||
float2 vSampledVelocityPixel = vSampledVelocity * g_vResolution.xy;
|
||||
|
||||
// 샘플의 스프레드 길이
|
||||
float fBlurSampleAccurate = abs(dot(vSampledVeloPixel, vBlurDirPixel));
|
||||
float fSampleSpreadLengthPixel = clamp(fBlurSampleAccurate, 0.f, fBlurRadiusPixel);
|
||||
if (true == bBorrowedVelocityFromTile)
|
||||
float fSampleVelocityVector = clamp(abs(dot(vSampledVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel);
|
||||
if (true == bBorrowedVelocity)
|
||||
{
|
||||
fSampleSpreadLengthPixel = max(fSampleSpreadLengthPixel, fCenterSpreadLengthPixel);
|
||||
fSampleVelocityVector = max(fSampleVelocityVector, fCurrentVelocityVector);
|
||||
}
|
||||
|
||||
// 샘플과 센터의 (깊이테스트 + 스프레드테스트)
|
||||
float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, fOffset, fCenterSpreadLengthPixel, fSampleSpreadLengthPixel, fScalePixelToSampleUnit, fScaleDepth);
|
||||
float fWeightCalculated = SampleWeight(fCenterDepth, fSampleDepth, fOffset,
|
||||
fCurrentVelocityVector, fSampleVelocityVector, fVelocityScale, fDepthScale);
|
||||
|
||||
if (fWeightCalculated <= 0.f) {
|
||||
continue;
|
||||
@@ -347,7 +351,7 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
|
||||
|
||||
float4 vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vSamplingUV);
|
||||
vAccColorSum += vSampledColor * fWeightCalculated;
|
||||
vAccVeloSum += vSampledVelo * fWeightCalculated;
|
||||
vAccVeloSum += vSampledVelocity * fWeightCalculated;
|
||||
fAccWeight += fWeightCalculated;
|
||||
}
|
||||
float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5);
|
||||
@@ -454,10 +458,10 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
|
||||
float2 uv = In.vTexcoord;
|
||||
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
float fSSAO_AmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r;
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
float fSSAO_AmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r;
|
||||
|
||||
float fViewZ = vDepth.y * g_fFar;
|
||||
|
||||
@@ -479,13 +483,25 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
float fAttenuation = 1.f;
|
||||
|
||||
float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz);
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로
|
||||
float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀 -> 카메라
|
||||
float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀 -> 라이트
|
||||
|
||||
if (g_bUsePhongShader)
|
||||
{
|
||||
vDepth.b = 0.f;
|
||||
}
|
||||
|
||||
if (false == CalcLighting(g_SurfaceTexture, vDepth.b, uv, vAlbedo, vF0, fMetallic, fRoughness, fOcclusion, fAttenuation))
|
||||
{
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fSSAO_AmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient));
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f);
|
||||
float NdotL = saturate(dot(vNormal, vToLight));
|
||||
float3 vHalf = normalize(vToView + vToLight);
|
||||
float NdotH = saturate(dot(vNormal, vHalf));
|
||||
|
||||
float3 vDiffuse = g_vLightDiffuse.rgb * vAlbedo * NdotL;
|
||||
float3 vAmbient = fSSAO_AmbientOcclusion * g_vLightAmbient.rgb * g_vMtrlAmbient.rgb * vAlbedo;
|
||||
|
||||
Out.vShade = float4(vDiffuse + vAmbient, 1.f);
|
||||
Out.vSpecular = float4((g_vLightSpecular.rgb * g_vMtrlSpecular.rgb) * pow(NdotH, 50.f), 0.f);
|
||||
Out.vSpecular.a = 0.f;
|
||||
return Out;
|
||||
}
|
||||
@@ -494,16 +510,15 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
|
||||
{ // 수치조정 // 디렉셔널
|
||||
float fMinRoughness = 0.05f;
|
||||
fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장
|
||||
fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 )
|
||||
vF0 = min(vF0, 0.9f); // 메탈릭 상한선
|
||||
fRoughness = max(fRoughness, fMinRoughness);
|
||||
fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness);
|
||||
vF0 = min(vF0, 0.9f);
|
||||
}
|
||||
|
||||
|
||||
PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, g_fLightIntensity, fAttenuation, vF0);
|
||||
PBR_Out.vShade *= fTotalOcclusion;
|
||||
|
||||
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
|
||||
float3 vAmbient = g_vLightAmbient.rgb * vAlbedo * fTotalOcclusion * fAttenuation;
|
||||
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
|
||||
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
|
||||
|
||||
@@ -570,8 +585,12 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
|
||||
if (false == CalcLighting(g_SurfaceTexture, vDepth.b, uv, vAlbedo, vF0, fMetallic, fRoughness, fOcclusion, fAttenuation))
|
||||
{
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fSSAO_AmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient));
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f);
|
||||
float NdotL = saturate(dot(vNormal, vToLight));
|
||||
float3 vHalf = normalize(vToView + vToLight);
|
||||
float NdotH = saturate(dot(vNormal, vHalf));
|
||||
|
||||
Out.vShade = float4(g_vLightDiffuse.rgb * vAlbedo * NdotL * fAttenuation, 1.f);
|
||||
Out.vSpecular = float4((g_vLightSpecular.rgb * g_vMtrlSpecular.rgb) * pow(NdotH, 50.f) * fAttenuation, 0.f);
|
||||
Out.vSpecular.a = 0.f;
|
||||
return Out;
|
||||
}
|
||||
@@ -589,11 +608,9 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
|
||||
PBR_Out.vShade *= fTotalOcclusion;
|
||||
|
||||
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
|
||||
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
|
||||
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
|
||||
|
||||
Out.vShade = float4(vFinalDiffuse, 1.f);
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(vFinalSpecular, 0.f);
|
||||
|
||||
return Out;
|
||||
@@ -671,15 +688,19 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
|
||||
if (false == CalcLighting(g_SurfaceTexture, vDepth.b, uv, vAlbedo, vF0, fMetallic, fRoughness, fOcclusion, fAttenuation))
|
||||
{
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fSSAO_AmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient));
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f);
|
||||
float NdotL = saturate(dot(vNormal, vToLight));
|
||||
float3 vHalf = normalize(vToView + vToLight);
|
||||
float NdotH = saturate(dot(vNormal, vHalf));
|
||||
|
||||
Out.vShade = float4(g_vLightDiffuse.rgb * vAlbedo * NdotL * fAttenuation, 1.f);
|
||||
Out.vSpecular = float4((g_vLightSpecular.rgb * g_vMtrlSpecular.rgb) * pow(NdotH, 50.f) * fAttenuation, 0.f);
|
||||
Out.vSpecular.a = 0.f;
|
||||
return Out;
|
||||
}
|
||||
|
||||
float fTotalOcclusion = saturate(fOcclusion * fSSAO_AmbientOcclusion);
|
||||
|
||||
{ // 수치조정 // 점광원
|
||||
{ // 수치조정 // 스포트
|
||||
float fMinRoughness = 0.05f;
|
||||
fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장
|
||||
fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 )
|
||||
@@ -690,11 +711,9 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
|
||||
PBR_Out.vShade *= fTotalOcclusion;
|
||||
|
||||
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
|
||||
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
|
||||
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
|
||||
|
||||
Out.vShade = float4(vFinalDiffuse, 1.f);
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(vFinalSpecular, 0.f);
|
||||
|
||||
return Out;
|
||||
@@ -726,26 +745,35 @@ PS_OUT_DEBUG_MOTIONBLUR PS_MAIN_DEBUG_MOTIONBLUR_INTENSE(PS_IN In)
|
||||
{
|
||||
PS_OUT_DEBUG_MOTIONBLUR Out;
|
||||
|
||||
float2 vBase = g_VelocityTexture.Sample(DefaultSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
float2 vTent = g_TileVelocityTexture.Sample(DefaultSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
float2 vBase = g_VelocityTexture.Sample(ClampSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
float2 vTent = g_TileVelocityTexture.Sample(ClampSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
|
||||
vBase *= 25.5f;
|
||||
vTent *= 25.5f;
|
||||
Out.vBaseMotionBlur.xy = vBase * 0.5f + 0.5f;
|
||||
Out.vBaseMotionBlur.z = 0.f;
|
||||
Out.vBaseMotionBlur.w = 1.f;
|
||||
Out.vTentMotionBlur.xy = vTent * 0.5f + 0.5f;
|
||||
Out.vTentMotionBlur.z = 0.f;
|
||||
Out.vTentMotionBlur.w = 1.f;
|
||||
if (AlmostEqual5(vBase.x, 0.f) && AlmostEqual5(vBase.y, 0.f))
|
||||
{
|
||||
Out.vBaseMotionBlur = float3(1.f, 1.f, 1.f);
|
||||
Out.vBaseMotionBlur = float4(1.f, 1.f, 1.f, 1.f);
|
||||
}
|
||||
if (AlmostEqual5(vTent.x, 0.f) && AlmostEqual5(vTent.y, 0.f))
|
||||
{
|
||||
Out.vTentMotionBlur = float3(1.f, 1.f, 1.f);
|
||||
Out.vTentMotionBlur = float4(1.f, 1.f, 1.f, 1.f);
|
||||
}
|
||||
return Out;
|
||||
};
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_DEBUG_RtoRGBA(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
Out.vBackBuffer = g_VelocityTexture.Sample(DefaultSampler, In.vTexcoord).xxxx;
|
||||
Out.vEnvironment = g_TileVelocityTexture.Sample(DefaultSampler, In.vTexcoord).xxxx;
|
||||
Out.vEnvironment.a = Out.vBackBuffer.a = 1.f;
|
||||
return Out;
|
||||
};
|
||||
PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
@@ -777,12 +805,12 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
vPreShadowPosition = vPosition;
|
||||
|
||||
/* (로컬위치 * 월드) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) */
|
||||
float4 vNearShadowPos = vPosition;
|
||||
float4 vMiddleShadowPos = vPosition;
|
||||
float4 vFarShadowPos = vPosition;
|
||||
vPreShadowPosition = vPosition;
|
||||
{
|
||||
vNearShadowPos = mul(vNearShadowPos, g_LightViewMatrix_NEAR);
|
||||
vNearShadowPos = mul(vNearShadowPos, g_LightProjMatrix_NEAR);
|
||||
@@ -796,42 +824,22 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, g_vNearShadowResolution, g_vShadowBias.x, g_vShadowRadiusTexel.x);
|
||||
float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, g_vMiddleShadowResolution, g_vShadowBias.y, g_vShadowRadiusTexel.y);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w);
|
||||
float fVisibilityStatic = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w);
|
||||
|
||||
////////////////////////////
|
||||
// 케스케이드
|
||||
float fDepthRatio = saturate(vDepthDesc.y);
|
||||
|
||||
// 경계 블렌딩 폭. 경계 섞는 비중
|
||||
float fShadowCascadeBlendWidthRatio = 0.02f; // 2% 섞음
|
||||
float fCascadeBlend_Front = smoothstep(
|
||||
g_fCascadeSplitRatioNear - g_fCascadeBlendRatio,
|
||||
g_fCascadeSplitRatioNear + g_fCascadeBlendRatio, fDepthRatio);
|
||||
|
||||
// 경계 주변 부드럽게 할 비중
|
||||
float fCascadeBlend_NearToMiddle = smoothstep(g_fCascadeSplitRatioNear - fShadowCascadeBlendWidthRatio,
|
||||
g_fCascadeSplitRatioNear + fShadowCascadeBlendWidthRatio, fDepthRatio);
|
||||
//float fCascadeBlend_MiddleToFar = smoothstep(g_fCascadeSplitRatioFar - fShadowCascadeBlendWidthRatio,
|
||||
//g_fCascadeSplitRatioFar + fShadowCascadeBlendWidthRatio, fDepthRatio);
|
||||
|
||||
// Near -> Middle
|
||||
float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_NearToMiddle);
|
||||
float fStaticShadowBlendWeight = smoothstep(
|
||||
g_fCascadeSplitRatioFar - g_fCascadeBlendRatio,
|
||||
g_fCascadeSplitRatioFar + g_fCascadeBlendRatio, fDepthRatio);
|
||||
|
||||
// 1번째 방법
|
||||
//Dynamic - > Static
|
||||
//부드럽게 전환
|
||||
|
||||
float fVisibilityCombinedLogical = min(fVisibilityDynamic, fVisibility_Static);
|
||||
float fStaticShadowBlendStartRatio = g_fCascadeSplitRatioFar;
|
||||
float fStaticShadowBlendWidthRatio = 0.05f;
|
||||
float fStaticShadowBlendEndRatio = min(1.0f, fStaticShadowBlendStartRatio + fStaticShadowBlendWidthRatio);
|
||||
float fStaticShadowBlendWeight = smoothstep(fStaticShadowBlendStartRatio, fStaticShadowBlendEndRatio, fDepthRatio);
|
||||
float fVisibilityCombined = lerp(fVisibilityDynamic, fVisibilityCombinedLogical, fStaticShadowBlendWeight);
|
||||
float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_Front);
|
||||
fVisibilityStatic = lerp(1.0f, fVisibilityStatic, fStaticShadowBlendWeight);
|
||||
|
||||
// 2번째 방법
|
||||
// Dynamic * Static 항상 최소곱
|
||||
//float fVisibilityCombined = saturate(fVisibilityDynamic * fVisibility_Static);
|
||||
|
||||
// 3번째 방법
|
||||
// Dynamic , Static 최소값만 취함
|
||||
//float fVisibilityCombined = min(fVisibilityDynamic, fVisibility_Static);
|
||||
float fVisibilityCombined = fVisibilityDynamic * fVisibilityStatic;
|
||||
|
||||
// 최소 밝기
|
||||
float fShadowMultiplier = lerp(g_fMinShadowBrightness, 1.0f, saturate(fVisibilityCombined));
|
||||
@@ -1264,22 +1272,24 @@ PS_OUT_BACKBUFFER PS_TONE_MAPPING(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
float4 vColor = g_OriginalTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vColor *= g_fToneMappingExposure;
|
||||
vColor = max(vColor, 0); // 후처리 음수 방지
|
||||
switch (g_iToneMappingType) {
|
||||
case 0:
|
||||
vColor /= g_fToneMappingExposure;
|
||||
// Pass
|
||||
break;
|
||||
case 1:
|
||||
vColor = float4(ReinHard_ToneMapper(vColor.xyz), 1.f);
|
||||
vColor *= g_fToneMappingExposure;
|
||||
vColor = float4(Reinhard_ToneMapper(vColor.xyz), 1.f);
|
||||
break;
|
||||
case 2:
|
||||
vColor *= g_fToneMappingExposure;
|
||||
vColor = float4(Filmic_ToneMapper(vColor.xyz), 1.f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Out.vBackBuffer = vColor;
|
||||
Out.vBackBuffer = vColor; // BackBuffer UNORM sRGB RTV. 감마 보정이 필요없음
|
||||
Out.vEnvironment = float4(0.f, 0.f, 0.f, 1.f);
|
||||
return Out;
|
||||
}
|
||||
@@ -1297,52 +1307,53 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
float4 vCenterViewPosition;
|
||||
{
|
||||
{ // 센터 뷰스페이스 포지션 복원
|
||||
vCenterViewPosition.x = uv.x * 2.f - 1.f;
|
||||
vCenterViewPosition.y = uv.y * -2.f + 1.f;
|
||||
vCenterViewPosition.z = vDepthDesc.x;
|
||||
vCenterViewPosition.w = 1.f;
|
||||
vCenterViewPosition *= fCenterViewSpaceZ;
|
||||
vCenterViewPosition = mul(vCenterViewPosition, g_invmatProj);
|
||||
vCenterViewPosition /= vCenterViewPosition.w;
|
||||
vCenterViewPosition /= vCenterViewPosition.w;
|
||||
}
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(PointSampler, uv).xyz * 2.f - 1.f);
|
||||
float3 vCenterViewNormal = mul(vNormal, (float3x3)g_ViewMatrix);
|
||||
float3 vCenterNormal = mul(vNormal, (float3x3) g_ViewMatrix);
|
||||
|
||||
float2 vNoiseScale = g_vResolution / 4.f;
|
||||
float3 vNoise = g_SSAONoiseTexture.Sample(SsaoDataSampler, uv * vNoiseScale).xyz;
|
||||
float3 vNoise = g_SSAONoiseTexture.Sample(SSAODataSampler, uv * vNoiseScale).xyz;
|
||||
|
||||
float3 vTangent = normalize(vNoise - vCenterViewNormal * dot(vNoise, vCenterViewNormal));
|
||||
float3 vBiNormal = cross(vCenterViewNormal, vTangent);
|
||||
float3x3 toViewTBNMatrix = float3x3(vTangent, vBiNormal, vCenterViewNormal);
|
||||
float3 vTangent = normalize(vNoise - vCenterNormal * dot(vNoise, vCenterNormal));
|
||||
float3 vBiNormal = cross(vCenterNormal, vTangent);
|
||||
float3x3 TBNMatrix = float3x3(vTangent, vBiNormal, vCenterNormal);
|
||||
|
||||
float fOcclusion = 0.f;
|
||||
[loop]
|
||||
for (uint i = 0; i < g_iKernelSize; ++i)
|
||||
{
|
||||
float3 vViewSamplePosVec = mul(g_SamplePos[i].xyz, toViewTBNMatrix); // TANSPACE -> VIEW
|
||||
float4 vViewSamplePos = vCenterViewPosition + float4(vViewSamplePosVec * g_fSSAORadius, 0.f);
|
||||
float4 vNDCSampleOffset = mul(vViewSamplePos, g_ProjMatrix);
|
||||
float3 vSampleVector= mul(g_SamplePos[i].xyz, TBNMatrix);
|
||||
float4 vSampleViewPosition = vCenterViewPosition + float4(vSampleVector * g_fSSAORadius, 0.f);
|
||||
float4 vNDCSampleOffset = mul(vSampleViewPosition, g_ProjMatrix);
|
||||
vNDCSampleOffset /= vNDCSampleOffset.w;
|
||||
|
||||
float2 sampleUV;
|
||||
sampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f;
|
||||
sampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f;
|
||||
float2 vSampleUV;
|
||||
vSampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f;
|
||||
vSampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f;
|
||||
|
||||
if (sampleUV.x < 0 || sampleUV.x > 1
|
||||
|| sampleUV.y < 0 || sampleUV.y > 1) {
|
||||
if (vSampleUV.x < 0 || vSampleUV.x > 1
|
||||
|| vSampleUV.y < 0 || vSampleUV.y > 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float fRecordedSampleViewPosDepth = g_DepthTexture.Sample(PointSampler, sampleUV).y * g_fFar;
|
||||
float fIsOccluded = (fRecordedSampleViewPosDepth < vViewSamplePos.z - g_fSSAO_BIAS) ? 1.0f : 0.0f;
|
||||
float fRecordedDepth = g_DepthTexture.Sample(PointSampler, vSampleUV).y * g_fFar;
|
||||
float fIsOccluded = (fRecordedDepth < vSampleViewPosition.z - g_fSSAO_BIAS) ? 1.0f : 0.0f;
|
||||
|
||||
float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vViewSamplePos.z - fRecordedSampleViewPosDepth));
|
||||
float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vSampleViewPosition.z - fRecordedDepth));
|
||||
fIsOccluded *= fRangeCheck;
|
||||
fOcclusion += fIsOccluded;
|
||||
}
|
||||
fOcclusion = saturate(1.f - (fOcclusion * g_fSSAOStrength / g_iKernelSize) * fRatio);
|
||||
Out.fOcclusion = fOcclusion ;
|
||||
Out.fOcclusion = fOcclusion;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -1602,4 +1613,13 @@ technique11 DefaultTechnique
|
||||
|
||||
PixelShader = compile ps_5_0 PS_MAIN_DEBUG_MOTIONBLUR_INTENSE();
|
||||
}
|
||||
pass DEBUG_RtoRGBA // 24
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_CAPTURE();
|
||||
|
||||
PixelShader = compile ps_5_0 PS_MAIN_DEBUG_RtoRGBA();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h
|
||||
{
|
||||
case 23: // 무거운데 올라갈 수 있는 벽
|
||||
if (m_pGameInstance->Key_Pressing(DIK_E)) {
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f));
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookVelocity(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f));
|
||||
}
|
||||
else if (m_pGameInstance->Key_Pressing(DIK_R)) {
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f));
|
||||
pOwnerActorData->pOwner->Get_Component<CTransform>()->BookVelocity(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f));
|
||||
}
|
||||
//pOwnerActorData->pOwner->Get_Component<CTransform>()->BookMomentum(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f));
|
||||
//pOwnerActorData->pOwner->Get_Component<CTransform>()->BookVelocity(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f));
|
||||
break;
|
||||
case 24: // 문짝
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ HRESULT CDummyObject::Initialize(void* pArg)
|
||||
|
||||
void CDummyObject::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
}
|
||||
|
||||
void CDummyObject::Update(_float fTimeDelta)
|
||||
|
||||
@@ -34,12 +34,12 @@ HRESULT CDummy_PhysXEffectHitBox::Initialize(void* pArg)
|
||||
|
||||
void CDummy_PhysXEffectHitBox::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
}
|
||||
|
||||
void CDummy_PhysXEffectHitBox::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos));
|
||||
m_pTransformCom->AccumulateVelocity(XMLoadFloat3(&m_vDeltaPos));
|
||||
}
|
||||
|
||||
void CDummy_PhysXEffectHitBox::Late_Update(_float fTimeDelta)
|
||||
|
||||
@@ -16,7 +16,7 @@ CDummy_PhysXMonster::CDummy_PhysXMonster(const CDummy_PhysXMonster& rhs) :
|
||||
|
||||
void CDummy_PhysXMonster::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
}
|
||||
|
||||
@@ -26,16 +26,16 @@ void CDummy_PhysXMonster::Update(_float fTimeDelta)
|
||||
GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y);
|
||||
if (true == m_pCharacter_Controller->IsActive()) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_DOWN)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
m_vStunTimer.x = 0.f;
|
||||
|
||||
@@ -21,30 +21,30 @@ CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs):
|
||||
|
||||
void CDummy_PhysXPlayable::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
}
|
||||
|
||||
void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_DOWN)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_SPACE)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_C)) {
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor(), m_pGameInstance->Get_CurrentLevelID());
|
||||
@@ -56,7 +56,7 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
}
|
||||
}
|
||||
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pTransformCom->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ HRESULT CEditEffect::Initialize(void* pArg)
|
||||
void CEditEffect::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
if(m_EffectInfo.isMotionBlur == true)
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
}
|
||||
|
||||
void CEditEffect::Update(_float fTimeDelta)
|
||||
|
||||
@@ -476,7 +476,7 @@ void CGoblin::Describe_Entity()
|
||||
GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio());
|
||||
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
|
||||
_float3 Pos;
|
||||
|
||||
@@ -210,7 +210,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta)
|
||||
vDistance = XMVector4Normalize(vDistance);
|
||||
_float step = dist - fDesiredRange;
|
||||
|
||||
m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 1.5f);
|
||||
m_pTransformCom->AccumulateVelocity(vDistance * step * fTimeDelta * 1.5f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,14 +60,13 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
return;
|
||||
#endif // gimch
|
||||
#ifdef 기무리
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::OBJECT))))
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT))))
|
||||
return;
|
||||
#endif // 기무리
|
||||
#ifdef 진우
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT))))
|
||||
return;
|
||||
#endif // 진우
|
||||
|
||||
}
|
||||
|
||||
HRESULT CLevel_Logo::Render()
|
||||
|
||||
@@ -75,15 +75,15 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
|
||||
#pragma region MONSTER
|
||||
|
||||
//futures.emplace_back(Deferred_ModelLoad(
|
||||
// MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/SK_GOB_M_T4Melee_INST_A_Master.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
// TEXT("Prototype_Component_SK_GOB_M_T4Melee_INST_A_Master_Model")
|
||||
//));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/SK_GOB_M_T4Melee_INST_A_Master.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_SK_GOB_M_T4Melee_INST_A_Master_Model")
|
||||
));
|
||||
|
||||
//futures.emplace_back(Deferred_ModelLoad(
|
||||
// MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin_Mage/GoblinMage.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
// TEXT("Prototype_Component_GoblinMage_Model")
|
||||
//));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin_Mage/GoblinMage.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_GoblinMage_Model")
|
||||
));
|
||||
|
||||
//futures.emplace_back(Deferred_ModelLoad(
|
||||
// MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
|
||||
|
||||
@@ -34,7 +34,7 @@ HRESULT CMonster::Initialize(void* pArg)
|
||||
|
||||
void CMonster::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
ReLockOnTarget();
|
||||
if (m_pCharacter_Controller->Get_GravityAmount() > 0.f)
|
||||
SetGravity();
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->ResetVelocityVector();
|
||||
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
@@ -530,7 +530,7 @@ void CPlayer::Describe_Entity()
|
||||
}
|
||||
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity());
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
_char label[256];
|
||||
for (auto& iter : m_KeyFrames)
|
||||
|
||||
@@ -137,22 +137,8 @@ float2 UV_Cutting(float2 vUV, float2 vUVCutting, uint iCurrentFrame)
|
||||
//}
|
||||
|
||||
|
||||
// (Kd F(Lambert)) + (Ks F(cook-torrance))
|
||||
|
||||
//float LambertDiffuse(float c)
|
||||
//{
|
||||
// return c / PI;
|
||||
//}
|
||||
|
||||
// F(cook-torrance)
|
||||
// DFG / (4 (Wo dot N) (Wi dot N))
|
||||
|
||||
// D(distribution, NormalDistribution function), 표면의 거칠기에 영향을 받는 halfWay vector
|
||||
// G(Geometry, GeometryFunc), 에너지 보존법칙 적용
|
||||
// F(Fresnel-Fresnel equation), 표면 각도에 따른 반사율
|
||||
|
||||
// F->D
|
||||
float NDF_ggxtr(float3 vNormal, float3 vHalfWayVector, float fAlpha) // NormalDistributionGGXTR, (H, halfWay vector), (A, Roughness), (N, Normal)
|
||||
float NDF_ggxtr(float3 vNormal, float3 vHalfWayVector, float fAlpha)
|
||||
{
|
||||
float a2 = fAlpha * fAlpha;
|
||||
float NdotH = saturate(dot(vNormal, vHalfWayVector));
|
||||
@@ -166,28 +152,14 @@ float NDF_ggxtr(float3 vNormal, float3 vHalfWayVector, float fAlpha) // NormalDi
|
||||
}
|
||||
|
||||
// F->G
|
||||
// GschlickGGX(n, v, k)
|
||||
// k는 이하 두개 조명 조건에 따라 가변적임
|
||||
// Direct // Kdir -> ((a + 1) * (a + 1)) / 8 // direct lighting 추천
|
||||
// IBL Lighting // Kibl -> a * a / 2 // 이미지 기반 조명기법
|
||||
|
||||
float Geometry_SchlickGGX(float NdotV, float fK)
|
||||
float Geometry_SchlickGGX(float NdotV, float fk)
|
||||
{
|
||||
return NdotV / (NdotV * (1.0f - fK) + fK);
|
||||
return NdotV / (NdotV * (1.0f - fk) + fk);
|
||||
}
|
||||
|
||||
float Geometry_Smith(float3 vNormal, float3 vFromView, float3 vFromLight, float k)
|
||||
float Geometry_Smith(float3 vNormal, float NdotV, float NdotL, float fk)
|
||||
{
|
||||
// Geometry Obstruction
|
||||
// 철이 있는, 주로 튀어나온 장애물
|
||||
float NdotV = saturate(dot(vNormal, vFromView));
|
||||
|
||||
// Geometry Shadowing
|
||||
// 요가 있는, 주로 음푹 들어간 장애물 (그래서 셰도잉)
|
||||
float NdotL = saturate(dot(vNormal, vFromLight));
|
||||
|
||||
// 요철이 골고루 있다고 가정하고 적당히 섞음
|
||||
return Geometry_SchlickGGX(NdotV, k) * Geometry_SchlickGGX(NdotL, k);
|
||||
return Geometry_SchlickGGX(NdotV, fk) * Geometry_SchlickGGX(NdotL, fk);
|
||||
}
|
||||
|
||||
// F -> F
|
||||
@@ -217,16 +189,17 @@ PBR_LIGHT_OUT PBR_Lighting(
|
||||
return Out;
|
||||
}
|
||||
|
||||
float fAlpha = max(fRoughness * fRoughness, 0.04f);
|
||||
float k = ((fRoughness + 1.f) * (fRoughness + 1.f)) / 8.f;
|
||||
float r = max(fRoughness, 0.046);
|
||||
float fAlpha = r * r;
|
||||
float k = ((r + 1.f) * (r + 1.f)) / 8.f;
|
||||
|
||||
float D = NDF_ggxtr(vNormal, vHalfVector, fAlpha);
|
||||
float G = Geometry_Smith(vNormal, vToView, vToLight, k);
|
||||
float G = Geometry_Smith(vNormal, NdotV, NdotL, k);
|
||||
float3 F = Fresnel_Schlick(saturate(dot(vHalfVector, vToView)), vFO);
|
||||
|
||||
float3 vNumerator = D * G * F;
|
||||
float3 vNominator = D * G * F;
|
||||
float fDenominator = max(4.f * NdotL * NdotV, 1e-7);
|
||||
float3 specularBRDF = vNumerator / fDenominator;
|
||||
float3 specularBRDF = vNominator / fDenominator;
|
||||
|
||||
float3 kS = F;
|
||||
float3 kD = (1.f - kS) * (1.f -fMetallic);
|
||||
@@ -322,22 +295,28 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv)
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
// BackGround ForeGround 합은 1
|
||||
float2 DepthCompare(float fCenterDepth, float fSampleDepth, float fDepthScale)
|
||||
float2 ComputeDepthWeights(float fCenterDepth, float fSampleDepth, float fDepthScale)
|
||||
{
|
||||
return saturate(0.5f + float2(fDepthScale, -fDepthScale) * (fSampleDepth - fCenterDepth));
|
||||
}
|
||||
float delta = fSampleDepth - fCenterDepth;
|
||||
|
||||
float2 SpreadCompare(float fOffsetLength, float2 fSpreadLength, float fPixelToSampleUnitsScale)
|
||||
{
|
||||
return saturate(fPixelToSampleUnitsScale * fSpreadLength - fOffsetLength + 1.f);
|
||||
float fBackgroundWeight = saturate(0.5f + fDepthScale * delta);
|
||||
float fForegroundWeight = 1.0f - fBackgroundWeight;
|
||||
|
||||
return float2(fBackgroundWeight, fForegroundWeight);
|
||||
}
|
||||
|
||||
float SampleWeight(float fCenterDepth, float fSampleDepth, float fOffsetLength, float fCenterSpreadLength, float fSampleSpreadLength, float fPixelToSampleUnitsScale, float fDepthScale)
|
||||
float ComputeSpreadWeight(float fStepOffset, float fSpreadLength, float fVelocityScale)
|
||||
{
|
||||
float2 vDepthCompare = DepthCompare(fCenterDepth, fSampleDepth, fDepthScale);
|
||||
float2 vSpreadCompare = SpreadCompare(fOffsetLength, float2(fCenterSpreadLength, fSampleSpreadLength), fPixelToSampleUnitsScale);
|
||||
return dot(vDepthCompare, vSpreadCompare);
|
||||
return saturate(fVelocityScale * fSpreadLength - fStepOffset + 1.f);
|
||||
}
|
||||
float SampleWeight(float fCenterDepth, float fSampleDepth, float fStepOffset, float fCenterSpreadLength,
|
||||
float fSampleSpreadLength, float fVelocityScale, float fDepthScale)
|
||||
{
|
||||
float2 vDepthCompare = ComputeDepthWeights(fCenterDepth, fSampleDepth, fDepthScale);
|
||||
|
||||
float fCenter = ComputeSpreadWeight(fStepOffset, fCenterSpreadLength, fVelocityScale);
|
||||
float fSample = ComputeSpreadWeight(fStepOffset, fSampleSpreadLength, fVelocityScale);
|
||||
|
||||
return vDepthCompare.x * fCenter + vDepthCompare.y * fSample;
|
||||
}
|
||||
|
||||
float4x4 RotateX(float fAngle)
|
||||
@@ -481,7 +460,7 @@ float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
return fAmount * fRatio;
|
||||
}
|
||||
|
||||
float3 ReinHard_ToneMapper(float3 vColor)
|
||||
float3 Reinhard_ToneMapper(float3 vColor)
|
||||
{
|
||||
float k = 1.f;
|
||||
vColor = (vColor / (vColor + k));
|
||||
@@ -496,10 +475,8 @@ float3 Filmic_ToneMapper(float3 vColor)
|
||||
const float fD = 0.59f;
|
||||
const float fE = 0.14f;
|
||||
|
||||
vColor = saturate(
|
||||
vColor * (fA * vColor + fB)
|
||||
/ (vColor * (fC * vColor + fD) + fE)
|
||||
);
|
||||
vColor = saturate( vColor * (fA * vColor + fB)
|
||||
/ (vColor * (fC * vColor + fD) + fE) );
|
||||
|
||||
return vColor;
|
||||
}
|
||||
@@ -585,24 +562,26 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex
|
||||
float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f)
|
||||
{
|
||||
float2 vReturnVelocity = float2(0.5f, 0.5f);
|
||||
if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5)
|
||||
{
|
||||
if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) {
|
||||
return vReturnVelocity;
|
||||
}
|
||||
|
||||
{
|
||||
float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w;
|
||||
float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w;
|
||||
|
||||
float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w;
|
||||
float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w;
|
||||
currentNDC.y *= -1.f;
|
||||
previousNDC.y *= -1.f;
|
||||
|
||||
currentNDC.y *= -1.f;
|
||||
previousNDC.y *= -1.f;
|
||||
float2 velocityUV = (currentNDC - previousNDC) * 0.5f;
|
||||
velocityUV *= fIntensity;
|
||||
velocityUV = clamp(velocityUV, -1.0f, 1.0f);
|
||||
|
||||
// UV 델타
|
||||
float2 velocityUV = (currentNDC - previousNDC) * 0.5f;
|
||||
velocityUV *= fIntensity;
|
||||
velocityUV = clamp(velocityUV, -1.0f, 1.0f);
|
||||
|
||||
return velocityUV * 0.5f + 0.5f; // 0 속도 -> 0.5
|
||||
vReturnVelocity = velocityUV * 0.5f + 0.5f;
|
||||
}
|
||||
return vReturnVelocity;
|
||||
}
|
||||
|
||||
float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos)
|
||||
{
|
||||
return CalcVelocityUV(vCurrentProjPos, vPreviousProjPos, 1.0f);
|
||||
|
||||
@@ -48,7 +48,6 @@ sampler BorderZeroSampler = sampler_state
|
||||
AddressV = Border;
|
||||
BorderColor = float4(0.f, 0.f, 0.f, 0.f);
|
||||
};
|
||||
|
||||
sampler BorderZeroLinearSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_LINEAR;
|
||||
@@ -65,7 +64,7 @@ sampler BorderOneSampler = sampler_state
|
||||
BorderColor = float4(1.f, 1.f, 1.f, 1.f);
|
||||
};
|
||||
|
||||
sampler SsaoDataSampler = sampler_state
|
||||
sampler SSAODataSampler = sampler_state
|
||||
{
|
||||
Filter = MIN_MAG_MIP_POINT;
|
||||
AddressU = wrap;
|
||||
|
||||
@@ -50,6 +50,7 @@ float g_fSpotOuterAngle;
|
||||
float g_fToneMappingExposure;
|
||||
uint g_iToneMappingType;
|
||||
bool g_bUsePowerLightAttenuation;
|
||||
bool g_bUsePhongShader;
|
||||
float g_fLightAttenuationPower;
|
||||
|
||||
vector g_vLightDir;
|
||||
@@ -100,6 +101,7 @@ vector g_vFogColor;
|
||||
float g_fDepthPackExponent;
|
||||
|
||||
Texture3D g_VolumeTexture;
|
||||
float g_fCascadeBlendRatio = 0.02f;
|
||||
|
||||
float g_fWeights_32[32] =
|
||||
{
|
||||
@@ -218,13 +220,13 @@ struct PS_OUT_BACKBUFFER
|
||||
};
|
||||
struct PS_OUT_DEBUG_MOTIONBLUR
|
||||
{
|
||||
float3 vBaseMotionBlur : SV_TARGET0;
|
||||
float3 vTentMotionBlur : SV_Target1;
|
||||
float4 vBaseMotionBlur : SV_TARGET0;
|
||||
float4 vTentMotionBlur : SV_Target1;
|
||||
};
|
||||
struct PS_OUT_LIGHT
|
||||
{
|
||||
vector vShade : SV_TARGET0;
|
||||
vector vSpecular : SV_TARGET1;
|
||||
float4 vShade : SV_TARGET0;
|
||||
float4 vSpecular : SV_TARGET1;
|
||||
};
|
||||
struct PS_OUT_FLT4_SINGLE
|
||||
{
|
||||
@@ -268,33 +270,34 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
|
||||
|
||||
float2 vCenterUV = In.vTexcoord;
|
||||
float2 vFullResolutionTexelSize = 1.f / g_vResolution;
|
||||
float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y;
|
||||
float2 vCenterVelo = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1
|
||||
float2 vCenterVeloPixel = vCenterVelo * g_vResolution.xy;
|
||||
bool bBorrowedVelocityFromTile = false;
|
||||
float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y * g_fFar;
|
||||
float2 vCenterVelocity = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1
|
||||
float2 vCenterVeloPixel = vCenterVelocity * g_vResolution.xy;
|
||||
bool bBorrowedVelocity = false;
|
||||
|
||||
float2 vBlurVelo = vCenterVelo;
|
||||
float2 vBlurVeloPixel = vCenterVeloPixel; // 프레임당 픽셀 이동량
|
||||
float2 vBlurVelocity = vCenterVelocity;
|
||||
float2 vBlurVelocityPixel = vCenterVelocity * g_vResolution.xy; // 프레임당 픽셀 이동량
|
||||
|
||||
float fVelocityEpsilon = 0.5f;
|
||||
|
||||
if (length(vBlurVeloPixel) < fVelocityEpsilon)
|
||||
if (length(vBlurVelocityPixel) < fVelocityEpsilon)
|
||||
{
|
||||
// 사실상 정지해 있던 픽셀이면 텐트벨로시티맵에서 빌려옴
|
||||
vBlurVelo = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f;
|
||||
vBlurVeloPixel = vBlurVelo * g_vResolution.xy;
|
||||
bBorrowedVelocityFromTile = true;
|
||||
vBlurVelocity = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f;
|
||||
vBlurVelocityPixel = vBlurVelocity * g_vResolution.xy;
|
||||
bBorrowedVelocity = true;
|
||||
}
|
||||
|
||||
if (length(vBlurVeloPixel) < fVelocityEpsilon) {
|
||||
if (length(vBlurVelocityPixel) < fVelocityEpsilon)
|
||||
{
|
||||
// 텐트벨로시티맵에서 빌려온 픽셀또한 정지해 있었으면 원본 그대로 반환
|
||||
Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV);
|
||||
Out.vVelocity = float2(0.5f, 0.5f);
|
||||
return Out;
|
||||
}
|
||||
float fPixelSpeed = length(vBlurVeloPixel);
|
||||
float fPixelSpeed = length(vBlurVelocityPixel);
|
||||
|
||||
float2 vBlurDirPixel = (vBlurVeloPixel / max(fPixelSpeed, FLT_EPSILON5));
|
||||
float2 vBlurDirPixel = (vBlurVelocityPixel / max(fPixelSpeed, FLT_EPSILON5));
|
||||
|
||||
// 픽셀의 속도로 블러 반경을 가변적으로 돌림
|
||||
float fBlurRadiusPixel = clamp(fPixelSpeed * 0.4f , 0.f, g_fMBMaxBlurRadius);
|
||||
@@ -307,39 +310,40 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
|
||||
float fSamplePixelSpeed = fBlurRadiusPixel / max((float) iMaxRadius, 1.f);
|
||||
|
||||
// 샘플유닛의 크기
|
||||
float fScalePixelToSampleUnit = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5);
|
||||
float fScaleDepth = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5);
|
||||
float fVelocityScale = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5);
|
||||
float fDepthScale = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5);
|
||||
float4 vAccColorSum = float4(0.f, 0.f, 0.f, 0.f);
|
||||
float2 vAccVeloSum = float2(0.f, 0.f);
|
||||
float fAccWeight = 0.f;
|
||||
|
||||
// 센터의 스프레드 길이
|
||||
float2 vReferenceVelocityPixel = bBorrowedVelocityFromTile ? vBlurVeloPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨
|
||||
float fCenterSpreadLengthPixel = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍
|
||||
float2 vReferenceVelocityPixel = bBorrowedVelocity ? vBlurVelocityPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨
|
||||
float fCurrentVelocityVector = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍
|
||||
|
||||
[loop]
|
||||
for (int iInterval = -iMaxRadius; iInterval <= iMaxRadius; ++iInterval) {
|
||||
float fOffset = (float) abs(iInterval);
|
||||
float2 vOffsetPixel = vBlurDirPixel * ((float) iInterval * fSamplePixelSpeed);
|
||||
for (int iStep = -iMaxRadius; iStep <= iMaxRadius; ++iStep)
|
||||
{
|
||||
float fOffset = (float) abs(iStep);
|
||||
float2 vOffsetPixel = vBlurDirPixel * ((float) iStep * fSamplePixelSpeed);
|
||||
float2 vSamplingUV = vCenterUV + vOffsetPixel * vFullResolutionTexelSize;
|
||||
if (false == IsValidUV(vSamplingUV)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
float fSampledDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y;
|
||||
float2 vSampledVelo = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f;
|
||||
float2 vSampledVeloPixel = vSampledVelo * g_vResolution.xy;
|
||||
float fSampleDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y * g_fFar;
|
||||
float2 vSampledVelocity = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f;
|
||||
float2 vSampledVelocityPixel = vSampledVelocity * g_vResolution.xy;
|
||||
|
||||
// 샘플의 스프레드 길이
|
||||
float fBlurSampleAccurate = abs(dot(vSampledVeloPixel, vBlurDirPixel));
|
||||
float fSampleSpreadLengthPixel = clamp(fBlurSampleAccurate, 0.f, fBlurRadiusPixel);
|
||||
if (true == bBorrowedVelocityFromTile)
|
||||
float fSampleVelocityVector = clamp(abs(dot(vSampledVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel);
|
||||
if (true == bBorrowedVelocity)
|
||||
{
|
||||
fSampleSpreadLengthPixel = max(fSampleSpreadLengthPixel, fCenterSpreadLengthPixel);
|
||||
fSampleVelocityVector = max(fSampleVelocityVector, fCurrentVelocityVector);
|
||||
}
|
||||
|
||||
// 샘플과 센터의 (깊이테스트 + 스프레드테스트)
|
||||
float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, fOffset, fCenterSpreadLengthPixel, fSampleSpreadLengthPixel, fScalePixelToSampleUnit, fScaleDepth);
|
||||
float fWeightCalculated = SampleWeight(fCenterDepth, fSampleDepth, fOffset,
|
||||
fCurrentVelocityVector, fSampleVelocityVector, fVelocityScale, fDepthScale);
|
||||
|
||||
if (fWeightCalculated <= 0.f) {
|
||||
continue;
|
||||
@@ -347,7 +351,7 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In)
|
||||
|
||||
float4 vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vSamplingUV);
|
||||
vAccColorSum += vSampledColor * fWeightCalculated;
|
||||
vAccVeloSum += vSampledVelo * fWeightCalculated;
|
||||
vAccVeloSum += vSampledVelocity * fWeightCalculated;
|
||||
fAccWeight += fWeightCalculated;
|
||||
}
|
||||
float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5);
|
||||
@@ -454,10 +458,10 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
|
||||
float2 uv = In.vTexcoord;
|
||||
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
float fSSAO_AmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r;
|
||||
float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb;
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f);
|
||||
float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv);
|
||||
float fSSAO_AmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r;
|
||||
|
||||
float fViewZ = vDepth.y * g_fFar;
|
||||
|
||||
@@ -479,13 +483,25 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
float fAttenuation = 1.f;
|
||||
|
||||
float fCameraDistance = length(g_vCamPosition.xyz - vWorldPosition.xyz);
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로
|
||||
float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀에서 라이트로
|
||||
float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀 -> 카메라
|
||||
float3 vToLight = normalize(-g_vLightDir.xyz); // 픽셀 -> 라이트
|
||||
|
||||
if (g_bUsePhongShader)
|
||||
{
|
||||
vDepth.b = 0.f;
|
||||
}
|
||||
|
||||
if (false == CalcLighting(g_SurfaceTexture, vDepth.b, uv, vAlbedo, vF0, fMetallic, fRoughness, fOcclusion, fAttenuation))
|
||||
{
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fSSAO_AmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient));
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f);
|
||||
float NdotL = saturate(dot(vNormal, vToLight));
|
||||
float3 vHalf = normalize(vToView + vToLight);
|
||||
float NdotH = saturate(dot(vNormal, vHalf));
|
||||
|
||||
float3 vDiffuse = g_vLightDiffuse.rgb * vAlbedo * NdotL;
|
||||
float3 vAmbient = fSSAO_AmbientOcclusion * g_vLightAmbient.rgb * g_vMtrlAmbient.rgb * vAlbedo;
|
||||
|
||||
Out.vShade = float4(vDiffuse + vAmbient, 1.f);
|
||||
Out.vSpecular = float4((g_vLightSpecular.rgb * g_vMtrlSpecular.rgb) * pow(NdotH, 50.f), 0.f);
|
||||
Out.vSpecular.a = 0.f;
|
||||
return Out;
|
||||
}
|
||||
@@ -494,16 +510,15 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
|
||||
{ // 수치조정 // 디렉셔널
|
||||
float fMinRoughness = 0.05f;
|
||||
fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장
|
||||
fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 )
|
||||
vF0 = min(vF0, 0.9f); // 메탈릭 상한선
|
||||
fRoughness = max(fRoughness, fMinRoughness);
|
||||
fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness);
|
||||
vF0 = min(vF0, 0.9f);
|
||||
}
|
||||
|
||||
|
||||
PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, g_fLightIntensity, fAttenuation, vF0);
|
||||
PBR_Out.vShade *= fTotalOcclusion;
|
||||
|
||||
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
|
||||
float3 vAmbient = g_vLightAmbient.rgb * vAlbedo * fTotalOcclusion * fAttenuation;
|
||||
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
|
||||
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
|
||||
|
||||
@@ -570,8 +585,12 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
|
||||
if (false == CalcLighting(g_SurfaceTexture, vDepth.b, uv, vAlbedo, vF0, fMetallic, fRoughness, fOcclusion, fAttenuation))
|
||||
{
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fSSAO_AmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient));
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f);
|
||||
float NdotL = saturate(dot(vNormal, vToLight));
|
||||
float3 vHalf = normalize(vToView + vToLight);
|
||||
float NdotH = saturate(dot(vNormal, vHalf));
|
||||
|
||||
Out.vShade = float4(g_vLightDiffuse.rgb * vAlbedo * NdotL * fAttenuation, 1.f);
|
||||
Out.vSpecular = float4((g_vLightSpecular.rgb * g_vMtrlSpecular.rgb) * pow(NdotH, 50.f) * fAttenuation, 0.f);
|
||||
Out.vSpecular.a = 0.f;
|
||||
return Out;
|
||||
}
|
||||
@@ -589,11 +608,9 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
|
||||
|
||||
PBR_Out.vShade *= fTotalOcclusion;
|
||||
|
||||
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
|
||||
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
|
||||
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
|
||||
|
||||
Out.vShade = float4(vFinalDiffuse, 1.f);
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(vFinalSpecular, 0.f);
|
||||
|
||||
return Out;
|
||||
@@ -671,15 +688,19 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
|
||||
if (false == CalcLighting(g_SurfaceTexture, vDepth.b, uv, vAlbedo, vF0, fMetallic, fRoughness, fOcclusion, fAttenuation))
|
||||
{
|
||||
Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fSSAO_AmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient));
|
||||
Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f);
|
||||
float NdotL = saturate(dot(vNormal, vToLight));
|
||||
float3 vHalf = normalize(vToView + vToLight);
|
||||
float NdotH = saturate(dot(vNormal, vHalf));
|
||||
|
||||
Out.vShade = float4(g_vLightDiffuse.rgb * vAlbedo * NdotL * fAttenuation, 1.f);
|
||||
Out.vSpecular = float4((g_vLightSpecular.rgb * g_vMtrlSpecular.rgb) * pow(NdotH, 50.f) * fAttenuation, 0.f);
|
||||
Out.vSpecular.a = 0.f;
|
||||
return Out;
|
||||
}
|
||||
|
||||
float fTotalOcclusion = saturate(fOcclusion * fSSAO_AmbientOcclusion);
|
||||
|
||||
{ // 수치조정 // 점광원
|
||||
{ // 수치조정 // 스포트
|
||||
float fMinRoughness = 0.05f;
|
||||
fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장
|
||||
fRoughness = saturate(saturate(fCameraDistance * 0.01f) * 0.1f + fRoughness); // 거리기반 러프니스 ( 대충 멀수록 반짝반짝한건 더 뭉개져서 표현 )
|
||||
@@ -690,11 +711,9 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In)
|
||||
|
||||
PBR_Out.vShade *= fTotalOcclusion;
|
||||
|
||||
float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation;
|
||||
float3 vFinalDiffuse = PBR_Out.vShade + vAmbient;
|
||||
float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb;
|
||||
|
||||
Out.vShade = float4(vFinalDiffuse, 1.f);
|
||||
Out.vShade = float4(PBR_Out.vShade, 1.f);
|
||||
Out.vSpecular = float4(vFinalSpecular, 0.f);
|
||||
|
||||
return Out;
|
||||
@@ -726,26 +745,35 @@ PS_OUT_DEBUG_MOTIONBLUR PS_MAIN_DEBUG_MOTIONBLUR_INTENSE(PS_IN In)
|
||||
{
|
||||
PS_OUT_DEBUG_MOTIONBLUR Out;
|
||||
|
||||
float2 vBase = g_VelocityTexture.Sample(DefaultSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
float2 vTent = g_TileVelocityTexture.Sample(DefaultSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
float2 vBase = g_VelocityTexture.Sample(ClampSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
float2 vTent = g_TileVelocityTexture.Sample(ClampSampler, In.vTexcoord).xy * 2.f - 1.f;
|
||||
|
||||
vBase *= 25.5f;
|
||||
vTent *= 25.5f;
|
||||
Out.vBaseMotionBlur.xy = vBase * 0.5f + 0.5f;
|
||||
Out.vBaseMotionBlur.z = 0.f;
|
||||
Out.vBaseMotionBlur.w = 1.f;
|
||||
Out.vTentMotionBlur.xy = vTent * 0.5f + 0.5f;
|
||||
Out.vTentMotionBlur.z = 0.f;
|
||||
Out.vTentMotionBlur.w = 1.f;
|
||||
if (AlmostEqual5(vBase.x, 0.f) && AlmostEqual5(vBase.y, 0.f))
|
||||
{
|
||||
Out.vBaseMotionBlur = float3(1.f, 1.f, 1.f);
|
||||
Out.vBaseMotionBlur = float4(1.f, 1.f, 1.f, 1.f);
|
||||
}
|
||||
if (AlmostEqual5(vTent.x, 0.f) && AlmostEqual5(vTent.y, 0.f))
|
||||
{
|
||||
Out.vTentMotionBlur = float3(1.f, 1.f, 1.f);
|
||||
Out.vTentMotionBlur = float4(1.f, 1.f, 1.f, 1.f);
|
||||
}
|
||||
return Out;
|
||||
};
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_DEBUG_RtoRGBA(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
Out.vBackBuffer = g_VelocityTexture.Sample(DefaultSampler, In.vTexcoord).xxxx;
|
||||
Out.vEnvironment = g_TileVelocityTexture.Sample(DefaultSampler, In.vTexcoord).xxxx;
|
||||
Out.vEnvironment.a = Out.vBackBuffer.a = 1.f;
|
||||
return Out;
|
||||
};
|
||||
PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
@@ -777,12 +805,12 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
vPreShadowPosition = vPosition;
|
||||
|
||||
/* (로컬위치 * 월드) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) */
|
||||
float4 vNearShadowPos = vPosition;
|
||||
float4 vMiddleShadowPos = vPosition;
|
||||
float4 vFarShadowPos = vPosition;
|
||||
vPreShadowPosition = vPosition;
|
||||
{
|
||||
vNearShadowPos = mul(vNearShadowPos, g_LightViewMatrix_NEAR);
|
||||
vNearShadowPos = mul(vNearShadowPos, g_LightProjMatrix_NEAR);
|
||||
@@ -796,42 +824,22 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, g_vNearShadowResolution, g_vShadowBias.x, g_vShadowRadiusTexel.x);
|
||||
float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, g_vMiddleShadowResolution, g_vShadowBias.y, g_vShadowRadiusTexel.y);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w);
|
||||
float fVisibilityStatic = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w);
|
||||
|
||||
////////////////////////////
|
||||
// 케스케이드
|
||||
float fDepthRatio = saturate(vDepthDesc.y);
|
||||
|
||||
// 경계 블렌딩 폭. 경계 섞는 비중
|
||||
float fShadowCascadeBlendWidthRatio = 0.02f; // 2% 섞음
|
||||
float fCascadeBlend_Front = smoothstep(
|
||||
g_fCascadeSplitRatioNear - g_fCascadeBlendRatio,
|
||||
g_fCascadeSplitRatioNear + g_fCascadeBlendRatio, fDepthRatio);
|
||||
|
||||
// 경계 주변 부드럽게 할 비중
|
||||
float fCascadeBlend_NearToMiddle = smoothstep(g_fCascadeSplitRatioNear - fShadowCascadeBlendWidthRatio,
|
||||
g_fCascadeSplitRatioNear + fShadowCascadeBlendWidthRatio, fDepthRatio);
|
||||
//float fCascadeBlend_MiddleToFar = smoothstep(g_fCascadeSplitRatioFar - fShadowCascadeBlendWidthRatio,
|
||||
//g_fCascadeSplitRatioFar + fShadowCascadeBlendWidthRatio, fDepthRatio);
|
||||
|
||||
// Near -> Middle
|
||||
float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_NearToMiddle);
|
||||
float fStaticShadowBlendWeight = smoothstep(
|
||||
g_fCascadeSplitRatioFar - g_fCascadeBlendRatio,
|
||||
g_fCascadeSplitRatioFar + g_fCascadeBlendRatio, fDepthRatio);
|
||||
|
||||
// 1번째 방법
|
||||
//Dynamic - > Static
|
||||
//부드럽게 전환
|
||||
|
||||
float fVisibilityCombinedLogical = min(fVisibilityDynamic, fVisibility_Static);
|
||||
float fStaticShadowBlendStartRatio = g_fCascadeSplitRatioFar;
|
||||
float fStaticShadowBlendWidthRatio = 0.05f;
|
||||
float fStaticShadowBlendEndRatio = min(1.0f, fStaticShadowBlendStartRatio + fStaticShadowBlendWidthRatio);
|
||||
float fStaticShadowBlendWeight = smoothstep(fStaticShadowBlendStartRatio, fStaticShadowBlendEndRatio, fDepthRatio);
|
||||
float fVisibilityCombined = lerp(fVisibilityDynamic, fVisibilityCombinedLogical, fStaticShadowBlendWeight);
|
||||
float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_Front);
|
||||
fVisibilityStatic = lerp(1.0f, fVisibilityStatic, fStaticShadowBlendWeight);
|
||||
|
||||
// 2번째 방법
|
||||
// Dynamic * Static 항상 최소곱
|
||||
//float fVisibilityCombined = saturate(fVisibilityDynamic * fVisibility_Static);
|
||||
|
||||
// 3번째 방법
|
||||
// Dynamic , Static 최소값만 취함
|
||||
//float fVisibilityCombined = min(fVisibilityDynamic, fVisibility_Static);
|
||||
float fVisibilityCombined = fVisibilityDynamic * fVisibilityStatic;
|
||||
|
||||
// 최소 밝기
|
||||
float fShadowMultiplier = lerp(g_fMinShadowBrightness, 1.0f, saturate(fVisibilityCombined));
|
||||
@@ -1264,22 +1272,24 @@ PS_OUT_BACKBUFFER PS_TONE_MAPPING(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
float4 vColor = g_OriginalTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vColor *= g_fToneMappingExposure;
|
||||
vColor = max(vColor, 0); // 후처리 음수 방지
|
||||
switch (g_iToneMappingType) {
|
||||
case 0:
|
||||
vColor /= g_fToneMappingExposure;
|
||||
// Pass
|
||||
break;
|
||||
case 1:
|
||||
vColor = float4(ReinHard_ToneMapper(vColor.xyz), 1.f);
|
||||
vColor *= g_fToneMappingExposure;
|
||||
vColor = float4(Reinhard_ToneMapper(vColor.xyz), 1.f);
|
||||
break;
|
||||
case 2:
|
||||
vColor *= g_fToneMappingExposure;
|
||||
vColor = float4(Filmic_ToneMapper(vColor.xyz), 1.f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Out.vBackBuffer = vColor;
|
||||
Out.vBackBuffer = vColor; // BackBuffer UNORM sRGB RTV. 감마 보정이 필요없음
|
||||
Out.vEnvironment = float4(0.f, 0.f, 0.f, 1.f);
|
||||
return Out;
|
||||
}
|
||||
@@ -1297,52 +1307,53 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
float4 vCenterViewPosition;
|
||||
{
|
||||
{ // 센터 뷰스페이스 포지션 복원
|
||||
vCenterViewPosition.x = uv.x * 2.f - 1.f;
|
||||
vCenterViewPosition.y = uv.y * -2.f + 1.f;
|
||||
vCenterViewPosition.z = vDepthDesc.x;
|
||||
vCenterViewPosition.w = 1.f;
|
||||
vCenterViewPosition *= fCenterViewSpaceZ;
|
||||
vCenterViewPosition = mul(vCenterViewPosition, g_invmatProj);
|
||||
vCenterViewPosition /= vCenterViewPosition.w;
|
||||
vCenterViewPosition /= vCenterViewPosition.w;
|
||||
}
|
||||
float3 vNormal = normalize(g_NormalTexture.Sample(PointSampler, uv).xyz * 2.f - 1.f);
|
||||
float3 vCenterViewNormal = mul(vNormal, (float3x3)g_ViewMatrix);
|
||||
float3 vCenterNormal = mul(vNormal, (float3x3) g_ViewMatrix);
|
||||
|
||||
float2 vNoiseScale = g_vResolution / 4.f;
|
||||
float3 vNoise = g_SSAONoiseTexture.Sample(SsaoDataSampler, uv * vNoiseScale).xyz;
|
||||
float3 vNoise = g_SSAONoiseTexture.Sample(SSAODataSampler, uv * vNoiseScale).xyz;
|
||||
|
||||
float3 vTangent = normalize(vNoise - vCenterViewNormal * dot(vNoise, vCenterViewNormal));
|
||||
float3 vBiNormal = cross(vCenterViewNormal, vTangent);
|
||||
float3x3 toViewTBNMatrix = float3x3(vTangent, vBiNormal, vCenterViewNormal);
|
||||
float3 vTangent = normalize(vNoise - vCenterNormal * dot(vNoise, vCenterNormal));
|
||||
float3 vBiNormal = cross(vCenterNormal, vTangent);
|
||||
float3x3 TBNMatrix = float3x3(vTangent, vBiNormal, vCenterNormal);
|
||||
|
||||
float fOcclusion = 0.f;
|
||||
[loop]
|
||||
for (uint i = 0; i < g_iKernelSize; ++i)
|
||||
{
|
||||
float3 vViewSamplePosVec = mul(g_SamplePos[i].xyz, toViewTBNMatrix); // TANSPACE -> VIEW
|
||||
float4 vViewSamplePos = vCenterViewPosition + float4(vViewSamplePosVec * g_fSSAORadius, 0.f);
|
||||
float4 vNDCSampleOffset = mul(vViewSamplePos, g_ProjMatrix);
|
||||
float3 vSampleVector= mul(g_SamplePos[i].xyz, TBNMatrix);
|
||||
float4 vSampleViewPosition = vCenterViewPosition + float4(vSampleVector * g_fSSAORadius, 0.f);
|
||||
float4 vNDCSampleOffset = mul(vSampleViewPosition, g_ProjMatrix);
|
||||
vNDCSampleOffset /= vNDCSampleOffset.w;
|
||||
|
||||
float2 sampleUV;
|
||||
sampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f;
|
||||
sampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f;
|
||||
float2 vSampleUV;
|
||||
vSampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f;
|
||||
vSampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f;
|
||||
|
||||
if (sampleUV.x < 0 || sampleUV.x > 1
|
||||
|| sampleUV.y < 0 || sampleUV.y > 1) {
|
||||
if (vSampleUV.x < 0 || vSampleUV.x > 1
|
||||
|| vSampleUV.y < 0 || vSampleUV.y > 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
float fRecordedSampleViewPosDepth = g_DepthTexture.Sample(PointSampler, sampleUV).y * g_fFar;
|
||||
float fIsOccluded = (fRecordedSampleViewPosDepth < vViewSamplePos.z - g_fSSAO_BIAS) ? 1.0f : 0.0f;
|
||||
float fRecordedDepth = g_DepthTexture.Sample(PointSampler, vSampleUV).y * g_fFar;
|
||||
float fIsOccluded = (fRecordedDepth < vSampleViewPosition.z - g_fSSAO_BIAS) ? 1.0f : 0.0f;
|
||||
|
||||
float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vViewSamplePos.z - fRecordedSampleViewPosDepth));
|
||||
float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vSampleViewPosition.z - fRecordedDepth));
|
||||
fIsOccluded *= fRangeCheck;
|
||||
fOcclusion += fIsOccluded;
|
||||
}
|
||||
fOcclusion = saturate(1.f - (fOcclusion * g_fSSAOStrength / g_iKernelSize) * fRatio);
|
||||
Out.fOcclusion = fOcclusion ;
|
||||
Out.fOcclusion = fOcclusion;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -1602,4 +1613,13 @@ technique11 DefaultTechnique
|
||||
|
||||
PixelShader = compile ps_5_0 PS_MAIN_DEBUG_MOTIONBLUR_INTENSE();
|
||||
}
|
||||
pass DEBUG_RtoRGBA // 24
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_CAPTURE();
|
||||
|
||||
PixelShader = compile ps_5_0 PS_MAIN_DEBUG_RtoRGBA();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,9 +262,9 @@ _bool CCharacter_Controller::UpdateGroundByCast(_float fTimeDelta)
|
||||
_float fDistanceFromGround = XMVectorGetX(XMVector3Dot(vFootToHitPos, vSurfaceNormal));
|
||||
_float fDotUpNormal = (fabsf(fDotUp) < FLT_EPSILON) ? FLT_EPSILON: fDotUp;
|
||||
_float fCurrentMomentumY = (-fDistanceFromGround / fDotUpNormal) * 0.3f;
|
||||
_vector vCurrentMomentum = m_pTransform->Get_CurrentMomentum();
|
||||
_vector vCurrentMomentum = m_pTransform->Get_CurrentVelocity();
|
||||
|
||||
m_pTransform->Set_CurrentMomentum( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) );
|
||||
m_pTransform->Set_CurrentVelocity( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) );
|
||||
Set_OnGroundFlag(true);
|
||||
if (m_fCurrentSlopeDegree < m_fWalkableSlopeDegree * 0.5f) {
|
||||
m_bSlide = false;
|
||||
@@ -292,17 +292,17 @@ void CCharacter_Controller::Move(_float fTimeDelta)
|
||||
const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다?
|
||||
if (true == m_bGravity) {
|
||||
if (0 >= m_iIsOnGround) { // 공중: 무조건 중력
|
||||
m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f));
|
||||
m_pTransform->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f));
|
||||
}
|
||||
else if ((iCoyote_Counter) >= m_iIsOnGround) {
|
||||
UpdateGroundByCast(fTimeDelta);// 바닥에 플레이어 붙이게 함
|
||||
}
|
||||
else if (m_fCurrentSlopeDegree > m_fWalkableSlopeDegree) { // 너무 가파른 경사: 중력
|
||||
m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pTransform->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_bSlide = true;
|
||||
}
|
||||
}
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum());
|
||||
XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentVelocity());
|
||||
m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,28 @@
|
||||
#include "FSM.h"
|
||||
#include "State.h"
|
||||
|
||||
static unordered_map<size_t, const char*> g_FSMStateName =
|
||||
{
|
||||
{ FSMSTATE::IDLE, "IDLE" },
|
||||
{ FSMSTATE::MOVE, "MOVE" },
|
||||
{ FSMSTATE::WALK, "WALK" },
|
||||
{ FSMSTATE::JOG, "JOG" },
|
||||
{ FSMSTATE::SPRINT, "SPRINT" },
|
||||
{ FSMSTATE::JUMP, "JUMP" },
|
||||
{ FSMSTATE::LAND, "LAND" },
|
||||
{ FSMSTATE::DODGE, "DODGE" },
|
||||
{ FSMSTATE::LIGHT_ATTACK, "LIGHT_ATTACK" },
|
||||
{ FSMSTATE::SPELL, "SPELL" },
|
||||
{ FSMSTATE::HIT, "HIT" },
|
||||
{ FSMSTATE::DEAD, "DEAD" },
|
||||
{ FSMSTATE::RUSH, "RUSH" },
|
||||
{ FSMSTATE::TUCKED, "TUCKED" },
|
||||
{ FSMSTATE::SLASH, "SLASH" },
|
||||
{ FSMSTATE::DASH, "DASH" },
|
||||
{ FSMSTATE::CUTSCENE, "CUTSCENE" }
|
||||
};
|
||||
|
||||
|
||||
CFSM::CFSM(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CComponent(pDevice, pContext)
|
||||
{
|
||||
@@ -60,6 +82,23 @@ HRESULT CFSM::Update_State(_float fTimeDelta)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
const char* CFSM::Get_CurrentStateName()
|
||||
{
|
||||
if (nullptr == m_pStateMask)
|
||||
return "NONE";
|
||||
|
||||
size_t mask = *m_pStateMask;
|
||||
|
||||
for (auto& pair : g_FSMStateName)
|
||||
{
|
||||
if (mask & pair.first)
|
||||
return pair.second;
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
|
||||
CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CFSM* pInstance = new CFSM(pDevice, pContext);
|
||||
|
||||
@@ -61,7 +61,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
|
||||
#endif // _DEBUG
|
||||
|
||||
#ifndef _DEBUG
|
||||
m_pThreadHolder = CThreadHolder::Create(12);
|
||||
m_pThreadHolder = CThreadHolder::Create(8);
|
||||
#endif // !_DEBUG
|
||||
|
||||
if (nullptr == m_pThreadHolder) {
|
||||
@@ -149,41 +149,26 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
|
||||
m_pKey_Manager->Update();
|
||||
m_pMouse_Manager->Update();
|
||||
m_pSound_Manager->Update();
|
||||
#ifdef _DEBUG
|
||||
m_pResource_Manager->Describe_Entity();
|
||||
m_pFog->Update_Fog();
|
||||
#endif // _DEBUG
|
||||
m_pPicking->Update();
|
||||
|
||||
m_pObject_Manager->Priority_Update(fExcuteTimeDelta);
|
||||
|
||||
m_pPipeLine->Update();
|
||||
|
||||
m_pObject_Manager->Update(fExcuteTimeDelta);
|
||||
|
||||
m_pPhysX_Manager->Update(fExcuteTimeDelta);
|
||||
|
||||
m_pObject_Manager->Late_Update(fExcuteTimeDelta);
|
||||
|
||||
m_pVolumetric->Dispatch();
|
||||
|
||||
m_pLevel_Manager->Update(fExcuteTimeDelta);
|
||||
m_pObject_Manager->Clear_DeadObj();
|
||||
|
||||
//m_pObstacle_Manager->Refresh_Region();
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Draw()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Compute_TimeDelta(TEXT("Timer_DrawCall"));
|
||||
#endif // _DEBUG
|
||||
m_pRenderer->Render();
|
||||
|
||||
m_pLevel_Manager->Render();
|
||||
#ifdef _DEBUG
|
||||
Compute_TimeDelta(TEXT("Timer_DrawCall"));
|
||||
#endif // _DEBUG
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -326,13 +311,9 @@ void CGameInstance::Render_Begin(const _float4* pClearColor)
|
||||
|
||||
void CGameInstance::Render_End()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Compute_TimeDelta(TEXT("Timer_Present"));
|
||||
#endif // _DEBUG
|
||||
m_pGraphic_Device->Present();
|
||||
#ifdef _DEBUG
|
||||
Compute_TimeDelta(TEXT("Timer_Present"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Bind_DepthStencil(CShader* pShader, const _char* pContantName)
|
||||
@@ -365,44 +346,41 @@ void CGameInstance::Compute_TimeDelta(const _wstring& strTimerTag)
|
||||
|
||||
void CGameInstance::Compute_FrameCount()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_fTimer_PriorityUpdate = Get_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
m_fTimer_Update = Get_TimeDelta(TEXT("Timer_Update"));
|
||||
m_fTimer_LateUpdate = Get_TimeDelta(TEXT("Timer_LateUpdate"));
|
||||
m_fTimer_DrawCall = Get_TimeDelta(TEXT("Timer_DrawCall"));
|
||||
m_fTimer_Present = Get_TimeDelta(TEXT("Timer_Present"));
|
||||
m_fTimer_Picking = Get_TimeDelta(TEXT("Timer_Picking"));
|
||||
m_fTimer_PhysX = Get_TimeDelta(TEXT("Timer_PhysX"));
|
||||
m_fTimer_Level = Get_TimeDelta(TEXT("Timer_Level"));
|
||||
m_fTimer_FrameCount = Get_TimeDelta(TEXT("Timer_FrameCount"));
|
||||
m_fTimer_PriorityUpdate = Get_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
m_fTimer_Update = Get_TimeDelta(TEXT("Timer_Update"));
|
||||
m_fTimer_LateUpdate = Get_TimeDelta(TEXT("Timer_LateUpdate"));
|
||||
m_fTimer_DrawCall = Get_TimeDelta(TEXT("Timer_DrawCall"));
|
||||
m_fTimer_Present = Get_TimeDelta(TEXT("Timer_Present"));
|
||||
m_fTimer_Picking = Get_TimeDelta(TEXT("Timer_Picking"));
|
||||
m_fTimer_PhysX = Get_TimeDelta(TEXT("Timer_PhysX"));
|
||||
m_fTimer_Level = Get_TimeDelta(TEXT("Timer_Level"));
|
||||
m_fTimer_FrameCount = Get_TimeDelta(TEXT("Timer_FrameCount"));
|
||||
|
||||
m_fTimer_Render_Priority = Get_TimeDelta(TEXT("Timer_Render_Priority"));
|
||||
m_fTimer_Render_Shadow = Get_TimeDelta(TEXT("Timer_Render_Shadow"));
|
||||
m_fTimer_Render_NonBlend = Get_TimeDelta(TEXT("Timer_Render_NonBlend"));
|
||||
m_fTimer_Render_SSAO = Get_TimeDelta(TEXT("Timer_Render_SSAO"));
|
||||
m_fTimer_Render_SSAO_BLUR = Get_TimeDelta(TEXT("Timer_Render_SSAO_BLUR"));
|
||||
m_fTimer_Render_LightAcc = Get_TimeDelta(TEXT("Timer_Render_LightAcc"));
|
||||
m_fTimer_Render_Blur = Get_TimeDelta(TEXT("Timer_Render_Blur"));
|
||||
m_fTimer_Render_Combined = Get_TimeDelta(TEXT("Timer_Render_Combined"));
|
||||
m_fTimer_Render_Occlusion = Get_TimeDelta(TEXT("Timer_Render_Occlusion"));
|
||||
m_fTimer_Render_EnvironmentPostProcess = Get_TimeDelta(TEXT("Timer_Render_EnvironmentPostProcess"));
|
||||
m_fTimer_Render_Fog = Get_TimeDelta(TEXT("Timer_Render_Fog"));
|
||||
m_fTimer_Render_Effect = Get_TimeDelta(TEXT("Timer_Render_Effect"));
|
||||
m_fTimer_Render_NonLight = Get_TimeDelta(TEXT("Timer_Render_NonLight"));
|
||||
m_fTimer_Render_Blend = Get_TimeDelta(TEXT("Timer_Render_Blend"));
|
||||
m_fTimer_Render_WeightBlend = Get_TimeDelta(TEXT("Timer_Render_WeightBlend"));
|
||||
m_fTimer_Render_PostProcessing = Get_TimeDelta(TEXT("Timer_Render_PostProcessing"));
|
||||
m_fTimer_Render_LastColor = Get_TimeDelta(TEXT("Timer_Render_LastColor"));
|
||||
m_fTimer_Render_Tone_Mapping = Get_TimeDelta(TEXT("Timer_Render_Tone_Mapping"));
|
||||
m_fTimer_Render_UI = Get_TimeDelta(TEXT("Timer_Render_UI"));
|
||||
m_fTimer_Render_UI_Overley = Get_TimeDelta(TEXT("Timer_Render_UI_Overley"));
|
||||
#endif // _DEBUG
|
||||
m_fTimer_Render_Priority = Get_TimeDelta(TEXT("Timer_Render_Priority"));
|
||||
m_fTimer_Render_Shadow = Get_TimeDelta(TEXT("Timer_Render_Shadow"));
|
||||
m_fTimer_Render_NonBlend = Get_TimeDelta(TEXT("Timer_Render_NonBlend"));
|
||||
m_fTimer_Render_SSAO = Get_TimeDelta(TEXT("Timer_Render_SSAO"));
|
||||
m_fTimer_Render_SSAO_BLUR = Get_TimeDelta(TEXT("Timer_Render_SSAO_BLUR"));
|
||||
m_fTimer_Render_LightAcc = Get_TimeDelta(TEXT("Timer_Render_LightAcc"));
|
||||
m_fTimer_Render_Blur = Get_TimeDelta(TEXT("Timer_Render_Blur"));
|
||||
m_fTimer_Render_Combined = Get_TimeDelta(TEXT("Timer_Render_Combined"));
|
||||
m_fTimer_Render_Occlusion = Get_TimeDelta(TEXT("Timer_Render_Occlusion"));
|
||||
m_fTimer_Render_EnvironmentPostProcess = Get_TimeDelta(TEXT("Timer_Render_EnvironmentPostProcess"));
|
||||
m_fTimer_Render_Fog = Get_TimeDelta(TEXT("Timer_Render_Fog"));
|
||||
m_fTimer_Render_Effect = Get_TimeDelta(TEXT("Timer_Render_Effect"));
|
||||
m_fTimer_Render_NonLight = Get_TimeDelta(TEXT("Timer_Render_NonLight"));
|
||||
m_fTimer_Render_Blend = Get_TimeDelta(TEXT("Timer_Render_Blend"));
|
||||
m_fTimer_Render_WeightBlend = Get_TimeDelta(TEXT("Timer_Render_WeightBlend"));
|
||||
m_fTimer_Render_PostProcessing = Get_TimeDelta(TEXT("Timer_Render_PostProcessing"));
|
||||
m_fTimer_Render_LastColor = Get_TimeDelta(TEXT("Timer_Render_LastColor"));
|
||||
m_fTimer_Render_Tone_Mapping = Get_TimeDelta(TEXT("Timer_Render_Tone_Mapping"));
|
||||
m_fTimer_Render_UI = Get_TimeDelta(TEXT("Timer_Render_UI"));
|
||||
m_fTimer_Render_UI_Overley = Get_TimeDelta(TEXT("Timer_Render_UI_Overley"));
|
||||
}
|
||||
|
||||
void CGameInstance::Present_TimeCost()
|
||||
{
|
||||
#pragma region TimeCost
|
||||
#ifdef _DEBUG
|
||||
_float fTotal = m_fTimer_PriorityUpdate
|
||||
+ m_fTimer_Update
|
||||
+ m_fTimer_LateUpdate
|
||||
@@ -654,7 +632,6 @@ void CGameInstance::Present_TimeCost()
|
||||
GUI::Text("%f\t%f", GUI::GetIO().Framerate, GUI::GetIO().DeltaTime);
|
||||
}
|
||||
GUI::End();
|
||||
#endif // _DEBUG
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -43,46 +43,36 @@ void CGameObject_Manager::Priority_Update(_float fTimeDelta)
|
||||
#ifndef gimch
|
||||
Describe_Entity();
|
||||
#endif // !gimch
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
#endif // _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
for (size_t i = 0; i < m_iNumLevels; i++)
|
||||
{
|
||||
for (auto& Pair : m_pLayers[i])
|
||||
Pair.second->Priority_Update(fTimeDelta);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void CGameObject_Manager::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Update"));
|
||||
#endif // _DEBUG
|
||||
for (size_t i = 0; i < m_iNumLevels; i++)
|
||||
{
|
||||
for (auto& Pair : m_pLayers[i])
|
||||
Pair.second->Update(fTimeDelta);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Update"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void CGameObject_Manager::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_LateUpdate"));
|
||||
#endif // _DEBUG
|
||||
for (size_t i = 0; i < m_iNumLevels; i++)
|
||||
{
|
||||
for (auto& Pair : m_pLayers[i])
|
||||
Pair.second->Late_Update(fTimeDelta);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_LateUpdate"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void CGameObject_Manager::Clear(_uint iLevelIndex)
|
||||
|
||||
@@ -57,18 +57,14 @@ _uint CLevel_Manager::Get_NextLevelID()
|
||||
|
||||
void CLevel_Manager::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Level"));
|
||||
#endif // _DEBUG
|
||||
if (nullptr == m_pCurrentLevel){
|
||||
return;
|
||||
}
|
||||
|
||||
m_pCurrentLevel->Update(fTimeDelta);
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Level"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
HRESULT CLevel_Manager::Render()
|
||||
|
||||
@@ -226,11 +226,7 @@ void CLight::Describe_Entity()
|
||||
GUI::Text("Direction:");
|
||||
GUI::InputFloat3("##Direction", (_float*)m_LightDesc.pDirection);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
m_pOwner->Get_Component<CTransform>()->Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
|
||||
GUI::TreePop();
|
||||
|
||||
@@ -575,7 +575,7 @@ void CModel::Update_RootBone(_float Amount)
|
||||
vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f);
|
||||
|
||||
if (m_bRootBone) {
|
||||
m_pTransform->AccumulateMomentum(vDeltaWorld);
|
||||
m_pTransform->AccumulateVelocity(vDeltaWorld);
|
||||
}
|
||||
else {
|
||||
XMStoreFloat4(&m_RootBoneMomentum, vDeltaWorld);
|
||||
|
||||
@@ -28,6 +28,7 @@ HRESULT CMotion_Trail::Update_Capture(_float fDeltaTime)
|
||||
CAPTUREINFO* pInfo = (*iter);
|
||||
pInfo->vCaptureLifeTime.x += fDeltaTime;
|
||||
if (m_fMaxCaptureLifeTime < pInfo->vCaptureLifeTime.x) {
|
||||
// LifeTime이 종료된 Capture는 정보를 지우고 보관
|
||||
if (FAILED(ClearInfos(*pInfo))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -84,9 +85,11 @@ HRESULT CMotion_Trail::Render(CShader* pShader)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// dispatch 전에 호출할 해야 합니다
|
||||
HRESULT CMotion_Trail::Capture_Model(ID3D11Buffer* pBoneBuffer, const _float4x4& matCurrentWorld)
|
||||
{
|
||||
CAPTUREINFO* pInfo = { nullptr };
|
||||
// 남은리소스가 있는지 검사하고 없다면 가장 마지막 캡쳐를 사용
|
||||
if (m_RemainingInfos->empty()) {
|
||||
pInfo = m_CaptureInfos->front();
|
||||
if (FAILED(ClearInfos(*pInfo))) {
|
||||
@@ -98,6 +101,7 @@ HRESULT CMotion_Trail::Capture_Model(ID3D11Buffer* pBoneBuffer, const _float4x4&
|
||||
pInfo = m_RemainingInfos->front();
|
||||
m_RemainingInfos->pop();
|
||||
}
|
||||
// 캡쳐되는 상황의 월드 트랜스폼과 본버퍼 기록
|
||||
m_pContext->CopyResource(pInfo->pBoneMatrixBuffer, pBoneBuffer);
|
||||
pInfo->WorldMatrix = matCurrentWorld;
|
||||
m_CaptureInfos->emplace_back(pInfo);
|
||||
@@ -118,8 +122,8 @@ HRESULT CMotion_Trail::Initialize_Prototype(MODELCAPTURE_DESC* pDesc)
|
||||
m_fMaxCaptureLifeTime = pDesc->fMaxCaptureLifeTime;
|
||||
m_iMaximumCapture = pDesc->iMaximumCapture;
|
||||
m_iNumBones = pDesc->iNumBones;
|
||||
m_CaptureInfos = new list<CAPTUREINFO*>;
|
||||
m_RemainingInfos = new queue<CAPTUREINFO*>;
|
||||
m_CaptureInfos = new list<CAPTUREINFO*>;
|
||||
m_RemainingInfos = new queue<CAPTUREINFO*>;
|
||||
vector<CAPTUREINFO*> Infos = {};
|
||||
for (_uint i = 0; i < m_iMaximumCapture; ++i) {
|
||||
CAPTUREINFO* pInfo = new CAPTUREINFO();
|
||||
|
||||
@@ -207,7 +207,7 @@ void CMouse_Manager::Describe_Entity()
|
||||
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
|
||||
if (GUI::CollapsingHeader("Mouse_Manager")) {
|
||||
GUI::Text("AccumulateMomentum %.2f, %.2f", m_vMove.x, m_vMove.y);
|
||||
GUI::Text("AccumulateVelocity %.2f, %.2f", m_vMove.x, m_vMove.y);
|
||||
GUI::Text("CurPos %d, %d", m_ptCurrentMouseCur.x, m_ptCurrentMouseCur.y);
|
||||
GUI::Text("Lock %d", m_bLockMouseToCenter);
|
||||
POINT pt = Get_MouseViewPortPos();
|
||||
|
||||
@@ -483,31 +483,28 @@ void CPhysX_Manager::Update_Kinematic()
|
||||
|
||||
if (pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)
|
||||
{
|
||||
if (nullptr == pBody->userData) {
|
||||
if (nullptr == pBody->userData) { // UserData nullptr -> 해제됨
|
||||
ReleasedList.emplace_back(pBody);
|
||||
continue;
|
||||
}
|
||||
PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pBody->userData;
|
||||
if (false == pUserData->bAutoOwnerTranslation) {
|
||||
if (false == pUserData->bAutoTranslation) {
|
||||
continue;
|
||||
}
|
||||
const CTransform* pTransform = pUserData->pOwner->Get_Component<CTransform>();
|
||||
|
||||
pActor->setKinematicTarget(XMWorldToPx_NoScaleNoFlip(pTransform->Get_XMWorldMatrix()));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (list<PSX::PxActor*>::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) {
|
||||
Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID());
|
||||
ReleasedActor = ReleasedList.erase(ReleasedActor);
|
||||
for (auto iterActor = ReleasedList.begin(); iterActor != ReleasedList.end();) {
|
||||
Detach_Actor(*(*iterActor), m_pGameInstance->Get_CurrentLevelID());
|
||||
iterActor = ReleasedList.erase(iterActor);
|
||||
}
|
||||
}
|
||||
|
||||
void CPhysX_Manager::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PhysX"));
|
||||
#endif // _DEBUG
|
||||
if (nullptr == m_pScene) {
|
||||
return;
|
||||
}
|
||||
@@ -517,30 +514,29 @@ void CPhysX_Manager::Update(_float fTimeDelta)
|
||||
{ // Simulate
|
||||
m_pScene->simulate((PSX::PxReal)fTimeDelta);
|
||||
_bool bResult = m_pScene->fetchResults(true);
|
||||
assert(bResult);
|
||||
}
|
||||
{ // Post
|
||||
Update_Dynamic_ActiveActors();
|
||||
//Update_Dynamic_AllActors();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PhysX"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
void CPhysX_Manager::Update_Dynamic_ActiveActors()
|
||||
{
|
||||
list<PSX::PxActor*> ReleasedList = {};
|
||||
PSX::PxU32 iNumActiveActor = {};
|
||||
PSX::PxU32 iNumActiveActor = {}; // 실제 피직스 이동을 한 액터들
|
||||
PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor);
|
||||
|
||||
for (PSX::PxU32 i = 0; i < iNumActiveActor; ++i) {
|
||||
PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)ppActiveActors[i]->userData;
|
||||
PSX::PxRigidDynamic* pActorDynamic = ppActiveActors[i]->is<PSX::PxRigidDynamic>();
|
||||
|
||||
if (nullptr != pActorDynamic) {
|
||||
if (nullptr == ppActiveActors[i]->userData) {
|
||||
if (nullptr == ppActiveActors[i]->userData) { // UserData nullptr -> 해제됨
|
||||
ReleasedList.emplace_back(ppActiveActors[i]);
|
||||
continue;
|
||||
}
|
||||
if (false == pUserData->bAutoOwnerTranslation) {
|
||||
if (false == pUserData->bAutoTranslation) {
|
||||
continue;
|
||||
}
|
||||
CTransform* pTransform = pUserData->pOwner->Get_Component<CTransform>();
|
||||
@@ -549,13 +545,14 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors()
|
||||
_float3 vOriginalScale = pTransform->Get_Scale();
|
||||
_matrix WorldMatrix = {};
|
||||
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p));
|
||||
WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(),
|
||||
XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p));
|
||||
pTransform->Set_WorldMatrix(WorldMatrix);
|
||||
}
|
||||
}
|
||||
for (list<PSX::PxActor*>::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) {
|
||||
Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID());
|
||||
ReleasedActor = ReleasedList.erase(ReleasedActor);
|
||||
for (auto iterActor = ReleasedList.begin(); iterActor != ReleasedList.end();) {
|
||||
Detach_Actor(*(*iterActor), m_pGameInstance->Get_CurrentLevelID());
|
||||
iterActor = ReleasedList.erase(iterActor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,13 +45,9 @@ HRESULT CPicking::Initialize(HWND hWnd, _uint iSizeX, _uint iSizeY)
|
||||
|
||||
void CPicking::Update()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Picking"));
|
||||
#endif // _DEBUG
|
||||
m_pGameInstance->Copy_RenderTargetTo(TEXT("Target_Depth"), m_pTexture2D);
|
||||
#ifdef _DEBUG
|
||||
m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Picking"));
|
||||
#endif // _DEBUG
|
||||
}
|
||||
_bool CPicking::isPicking(_float3* pOut)
|
||||
{
|
||||
|
||||
@@ -23,23 +23,23 @@ void CPipeLine::Set_Environment(_float2 vNFBoxRatio, _float2 vSafeRadius, _float
|
||||
|
||||
m_vShadowBias = vShadowBias;
|
||||
m_vShadowRadius = vShadowRadius;
|
||||
m_vShadowBoxMarginMin = vShadowBoxMarginMin;
|
||||
m_vShadowBoxMarginMax = vShadowBoxMarginMax;
|
||||
m_vShadowMarginMin = vShadowBoxMarginMin;
|
||||
m_vShadowMarginMax = vShadowBoxMarginMax;
|
||||
}
|
||||
|
||||
void CPipeLine::Set_Transform(D3DTS eState, _fmatrix TransformStateMatrix)
|
||||
{
|
||||
XMStoreFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(eState)], TransformStateMatrix);
|
||||
XMStoreFloat4x4(&m_TransformMatrices[ENUM_CLASS(eState)], TransformStateMatrix);
|
||||
}
|
||||
|
||||
const _float4x4* CPipeLine::Get_Transform_Float4x4(D3DTS eState)
|
||||
{
|
||||
return &m_TransformStateMatrices[ENUM_CLASS(eState)];
|
||||
return &m_TransformMatrices[ENUM_CLASS(eState)];
|
||||
}
|
||||
|
||||
_matrix CPipeLine::Get_Transform_Matrix(D3DTS eState)
|
||||
{
|
||||
return XMLoadFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(eState)]);
|
||||
return XMLoadFloat4x4(&m_TransformMatrices[ENUM_CLASS(eState)]);
|
||||
}
|
||||
|
||||
_matrix CPipeLine::Get_ShadowTransform_Matrix(D3DTS eState, SHADOW eShadowType)
|
||||
@@ -56,7 +56,7 @@ _matrix CPipeLine::Get_ShadowTransform_Matrix(D3DTS eState, SHADOW eShadowType)
|
||||
}
|
||||
assert(iPass != UINT_MAX);
|
||||
|
||||
return XMLoadFloat4x4(&m_ShadowTransformStateMatrices[iPass][ENUM_CLASS(eState)]);
|
||||
return XMLoadFloat4x4(&m_ShadowTransformMatrices[iPass][ENUM_CLASS(eState)]);
|
||||
}
|
||||
|
||||
const _float4* CPipeLine::Get_CamPosition()
|
||||
@@ -107,7 +107,7 @@ pair<_bool, _ubyte> CPipeLine::IsIn_ShadowViewFrustum(_fvector vWorldCenter, _fl
|
||||
{
|
||||
pair<_bool, _ubyte> pairResult = { false, 0 };
|
||||
// 월드 센터를 셰도우뷰 센터로 바꿈
|
||||
_vector vShadowViewCenter = XMVectorSetW(XMVector3Rotate(vWorldCenter, XMLoadFloat4(&m_vShadowInvDirectionalRPYQuat)), 1.f);
|
||||
_vector vShadowViewCenter = XMVectorSetW(XMVector3Rotate(vWorldCenter, XMLoadFloat4(&m_vShadowInvQuat)), 1.f);
|
||||
|
||||
_float fSafeRadius = (fRadius + m_fSafe_RadiusMargin) * m_fSafe_RadiusMultiplier; // 그림자임을 고려해서 객체 부피보다 좀 더 넓게 탐색
|
||||
|
||||
@@ -208,8 +208,8 @@ HRESULT CPipeLine::End_OutLine_Write()
|
||||
HRESULT CPipeLine::Ready_Shadow_Light(const _float4& vShadowDirRPYQuat)
|
||||
{
|
||||
_vector vShadowQuat = XMQuaternionNormalize(XMLoadFloat4(&vShadowDirRPYQuat));
|
||||
XMStoreFloat4(&m_vShadowDirectionalRPYQuat, vShadowQuat);
|
||||
XMStoreFloat4(&m_vShadowInvDirectionalRPYQuat, XMQuaternionInverse(vShadowQuat));
|
||||
XMStoreFloat4(&m_vShadowQuat, vShadowQuat);
|
||||
XMStoreFloat4(&m_vShadowInvQuat, XMQuaternionInverse(vShadowQuat));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -230,12 +230,12 @@ HRESULT CPipeLine::Bind_Shadow_Resource(CShader* pShader, const _char* pConstant
|
||||
}
|
||||
assert(iPass != UINT_MAX);
|
||||
|
||||
return pShader->Bind_Matrix(pConstantName, &m_ShadowTransformStateMatrices[iPass][ENUM_CLASS(eType)]);
|
||||
return pShader->Bind_Matrix(pConstantName, &m_ShadowTransformMatrices[iPass][ENUM_CLASS(eType)]);
|
||||
}
|
||||
|
||||
const _float4x4* CPipeLine::Get_ShadowMatricesPtr(_uint iShadowBoxIndex)
|
||||
{
|
||||
return m_ShadowTransformStateMatrices[iShadowBoxIndex];
|
||||
return m_ShadowTransformMatrices[iShadowBoxIndex];
|
||||
}
|
||||
|
||||
_float CPipeLine::Get_ShadowBoxFar(_uint iShadowBoxIndex)
|
||||
@@ -254,21 +254,27 @@ _float CPipeLine::Get_ShadowBoxFar(_uint iShadowBoxIndex)
|
||||
|
||||
void CPipeLine::Update()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
static _bool m_bRenderSystem = false;
|
||||
if (m_pGameInstance->Key_Up(DIK_F6)) {
|
||||
m_bRenderSystem = !m_bRenderSystem;
|
||||
}
|
||||
if (true == m_bRenderSystem) {
|
||||
Describe_Entity();
|
||||
}
|
||||
#endif // RELEASE_DEBUGGER
|
||||
Update_ShadowDepthNdcZ();
|
||||
|
||||
XMStoreFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(D3DTS::VIEW_INV)], XMMatrixInverse(nullptr, Get_Transform_Matrix(D3DTS::VIEW)));
|
||||
XMStoreFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, Get_Transform_Matrix(D3DTS::PROJ)));
|
||||
XMStoreFloat4x4(&m_TransformMatrices[ENUM_CLASS(D3DTS::VIEW_INV)], XMMatrixInverse(nullptr, Get_Transform_Matrix(D3DTS::VIEW)));
|
||||
XMStoreFloat4x4(&m_TransformMatrices[ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, Get_Transform_Matrix(D3DTS::PROJ)));
|
||||
|
||||
|
||||
memcpy(&m_vCamPosition, &m_TransformStateMatrices[ENUM_CLASS(D3DTS::VIEW_INV)].m[3], sizeof(_float4));
|
||||
_matrix ProjInvMatrix = XMLoadFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(D3DTS::PROJ_INV)]);
|
||||
_matrix ViewInvMatrix = XMLoadFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(D3DTS::VIEW_INV)]);
|
||||
memcpy(&m_vCamPosition, &m_TransformMatrices[ENUM_CLASS(D3DTS::VIEW_INV)].m[3], sizeof(_float4));
|
||||
_matrix ProjInvMatrix = XMLoadFloat4x4(&m_TransformMatrices[ENUM_CLASS(D3DTS::PROJ_INV)]);
|
||||
_matrix ViewInvMatrix = XMLoadFloat4x4(&m_TransformMatrices[ENUM_CLASS(D3DTS::VIEW_INV)]);
|
||||
_matrix WorldFromClipMatrix = XMMatrixMultiply(ProjInvMatrix, ViewInvMatrix);
|
||||
|
||||
_vector vShadowInvQuat = XMLoadFloat4(&m_vShadowInvDirectionalRPYQuat);
|
||||
_vector vShadowInvQuat = XMLoadFloat4(&m_vShadowInvQuat);
|
||||
for (size_t i = 0; i < 8; ++i)
|
||||
{
|
||||
XMStoreFloat4(&m_vWorldPoints[i], XMVector3TransformCoord(XMLoadFloat4(&m_vOriginalRenderFrustumPoints[i]), WorldFromClipMatrix));
|
||||
@@ -308,7 +314,7 @@ HRESULT CPipeLine::Initialize()
|
||||
m_vOriginalShadowFrustumPoints[15] = m_vOriginalRenderFrustumPoints[7] = _float4(-1.f, -1.f, 1.f, 1.f); // LB
|
||||
|
||||
for (_uint i = ENUM_CLASS(D3DTS::VIEW); i < ENUM_CLASS(D3DTS::END); ++i) {
|
||||
XMStoreFloat4x4(&m_TransformStateMatrices[i], XMMatrixIdentity());
|
||||
XMStoreFloat4x4(&m_TransformMatrices[i], XMMatrixIdentity());
|
||||
}
|
||||
|
||||
if (nullptr == m_pDSS_OutLineWrite) {
|
||||
@@ -350,16 +356,17 @@ void CPipeLine::Make_Planes(const _float4* pPoints, _float4* pPlanes)
|
||||
|
||||
void CPipeLine::Make_LightBoxes()
|
||||
{
|
||||
// AABB Lighting space
|
||||
_vector vShadowInvQuat = XMLoadFloat4(&m_vShadowInvDirectionalRPYQuat);
|
||||
_matrix ViewMatrix = XMMatrixRotationQuaternion(vShadowInvQuat);
|
||||
// Directional Light 기준 View Matrix
|
||||
_matrix ViewMatrix = XMMatrixRotationQuaternion(XMLoadFloat4(&m_vShadowInvQuat));
|
||||
_matrix ViewInvMatrix = XMMatrixInverse(nullptr, ViewMatrix);
|
||||
|
||||
for (_uint iIndex = 0; iIndex < 3; ++iIndex)
|
||||
// Cascaded Shadow Map (3단계: Near / Middle / Far)
|
||||
for (_uint iCSMIndex = 0; iCSMIndex < 3; ++iCSMIndex)
|
||||
{
|
||||
_float4 vCascadePoints8[8] = {};
|
||||
Get_CascadePoints8(m_vShadowViewPoints, iIndex, vCascadePoints8);
|
||||
Get_CascadePoints8(m_vShadowViewPoints, iCSMIndex, vCascadePoints8);
|
||||
|
||||
// AABB 초기값 설정 (첫 번째 점 기준)
|
||||
_float fMinX = vCascadePoints8[0].x;
|
||||
_float fMinY = vCascadePoints8[0].y;
|
||||
_float fMinZ = vCascadePoints8[0].z;
|
||||
@@ -368,6 +375,7 @@ void CPipeLine::Make_LightBoxes()
|
||||
_float fMaxY = vCascadePoints8[0].y;
|
||||
_float fMaxZ = vCascadePoints8[0].z;
|
||||
|
||||
// 8개의 점을 순회하면서 AABB 계산 (Bounding Box 생성)
|
||||
for (_uint iPointIndex = 1; iPointIndex < 8; ++iPointIndex)
|
||||
{
|
||||
fMinX = min(fMinX, vCascadePoints8[iPointIndex].x);
|
||||
@@ -379,21 +387,18 @@ void CPipeLine::Make_LightBoxes()
|
||||
fMaxZ = max(fMaxZ, vCascadePoints8[iPointIndex].z);
|
||||
}
|
||||
|
||||
_float4* targetPlanes = nullptr;
|
||||
if (iIndex == 0) targetPlanes = m_vNearShadowViewBoxPlane;
|
||||
if (iIndex == 1) targetPlanes = m_vMiddleShadowViewBoxPlane;
|
||||
if (iIndex == 2) targetPlanes = m_vFarShadowViewBoxPlane;
|
||||
|
||||
fMinX += m_vShadowBoxMarginMin.x;
|
||||
fMaxX += m_vShadowBoxMarginMax.x;
|
||||
fMinY += m_vShadowBoxMarginMin.y;
|
||||
fMaxY += m_vShadowBoxMarginMax.y;
|
||||
fMinZ += m_vShadowBoxMarginMin.z;
|
||||
fMaxZ += m_vShadowBoxMarginMax.z;
|
||||
// Shadow Box 여유 공간 추가 (Shadow clipping 방지 / 안정성 확보)
|
||||
fMinX += m_vShadowMarginMin.x;
|
||||
fMaxX += m_vShadowMarginMax.x;
|
||||
fMinY += m_vShadowMarginMin.y;
|
||||
fMaxY += m_vShadowMarginMax.y;
|
||||
fMinZ += m_vShadowMarginMin.z;
|
||||
fMaxZ += m_vShadowMarginMax.z;
|
||||
|
||||
// Cascade 별 Shadow Map 해상도 설정
|
||||
_uint iShadowWidth = { 0 };
|
||||
_uint iShadowHeight = { 0 };
|
||||
switch (iIndex)
|
||||
switch (iCSMIndex)
|
||||
{
|
||||
case 0:
|
||||
iShadowWidth = g_iNearShadowWidth;
|
||||
@@ -413,21 +418,32 @@ void CPipeLine::Make_LightBoxes()
|
||||
|
||||
Adjust_ShadowTexcel(fMinX, fMinY, fMaxX, fMaxY, iShadowWidth, iShadowHeight);
|
||||
|
||||
targetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left
|
||||
targetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right
|
||||
targetPlanes[2] = _float4(0.f, -1.f, 0.f, fMinY); // Bottom
|
||||
targetPlanes[3] = _float4(0.f, 1.f, 0.f, -fMaxY); // Top
|
||||
targetPlanes[4] = _float4(0.f, 0.f, -1.f, fMinZ); // Near
|
||||
targetPlanes[5] = _float4(0.f, 0.f, 1.f, -fMaxZ); // Far
|
||||
// 각 Cascade 별로 결과를 저장할 Plane 배열 선택
|
||||
_float4* pTargetPlanes = nullptr;
|
||||
if (iCSMIndex == 0) pTargetPlanes = m_vNearShadowViewBoxPlane;
|
||||
if (iCSMIndex == 1) pTargetPlanes = m_vMiddleShadowViewBoxPlane;
|
||||
if (iCSMIndex == 2) pTargetPlanes = m_vFarShadowViewBoxPlane;
|
||||
|
||||
XMStoreFloat4x4(&m_ShadowTransformStateMatrices[iIndex][ENUM_CLASS(D3DTS::VIEW)], ViewMatrix);
|
||||
XMStoreFloat4x4(&m_ShadowTransformStateMatrices[iIndex][ENUM_CLASS(D3DTS::VIEW_INV)], ViewInvMatrix);
|
||||
// Light-Space AABB를 Plane 형태로 변환 (Frustum 형태)
|
||||
// 물체는 그대로 World 좌표 사용
|
||||
// Plane vs Bounding Volume 테스트만 수행
|
||||
pTargetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left
|
||||
pTargetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right
|
||||
pTargetPlanes[2] = _float4(0.f, -1.f, 0.f, fMinY); // Bottom
|
||||
pTargetPlanes[3] = _float4(0.f, 1.f, 0.f, -fMaxY); // Top
|
||||
pTargetPlanes[4] = _float4(0.f, 0.f, -1.f, fMinZ); // Near
|
||||
pTargetPlanes[5] = _float4(0.f, 0.f, 1.f, -fMaxZ); // Far
|
||||
|
||||
// Orthographic Projection 생성 Off-Center 방식 사용
|
||||
_matrix ProjMatrix = XMMatrixOrthographicOffCenterLH(fMinX, fMaxX, fMinY, fMaxY, fMinZ, fMaxZ);
|
||||
XMStoreFloat4x4(&m_ShadowTransformStateMatrices[iIndex][ENUM_CLASS(D3DTS::PROJ)], ProjMatrix);
|
||||
XMStoreFloat4x4(&m_ShadowTransformStateMatrices[iIndex][ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, ProjMatrix));
|
||||
}
|
||||
|
||||
// Light View / View Inverse 저장
|
||||
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::VIEW)], ViewMatrix);
|
||||
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::VIEW_INV)], ViewInvMatrix);
|
||||
// Light Projection / Projection Inverse 저장
|
||||
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::PROJ)], ProjMatrix);
|
||||
XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, ProjMatrix));
|
||||
}
|
||||
}
|
||||
|
||||
void CPipeLine::Get_CascadePoints8(const _float4* pShadowViewPoints16, _uint iIndexCascade, _float4* pOutPoints8)
|
||||
@@ -545,13 +561,13 @@ void CPipeLine::Free()
|
||||
m_mapGlobalSRV.clear();
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
|
||||
void CPipeLine::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("SYSTEM");
|
||||
if (GUI::CollapsingHeader("PipeLine")) {
|
||||
GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH);
|
||||
GUI::PushItemWidth(400);
|
||||
_bool bModified = { false };
|
||||
_float fNear = m_fShadowNearBoxRatio;
|
||||
_float fFar = m_fShadowFarBoxRatio;
|
||||
@@ -559,20 +575,20 @@ void CPipeLine::Describe_Entity()
|
||||
_float fSafe_RadiusMargin = m_fSafe_RadiusMargin;
|
||||
_float4 vShadowBias = m_vShadowBias;
|
||||
_float4 vShadowRadius = m_vShadowRadius;
|
||||
_float3 vShadowBoxMarginMin = m_vShadowBoxMarginMin;
|
||||
_float3 vShadowBoxMarginMax = m_vShadowBoxMarginMax;
|
||||
_float3 vShadowBoxMarginMin = m_vShadowMarginMin;
|
||||
_float3 vShadowBoxMarginMax = m_vShadowMarginMax;
|
||||
if (GUI::DragFloat("m_fShadowNearBoxRatio", &fNear, 0.001f, 0.001f, 0.999f, "%.3f")) {
|
||||
bModified = true;
|
||||
}
|
||||
if (GUI::DragFloat("m_fShadowFarBoxRatio", &fFar, 0.001f, 0.001f, 0.999f, "%.3f")) {
|
||||
bModified = true;
|
||||
}
|
||||
if (GUI::DragFloat("m_fSafe_RadiusMultiplier", &fSafe_RadiusMultiplier, 0.01f, 1.f, 3.f, "%.3f")) {
|
||||
bModified = true;
|
||||
}
|
||||
if (GUI::DragFloat("m_fSafe_RadiusMargin", &fSafe_RadiusMargin, 1.f, 10.f, 40.f, "%.3f")) {
|
||||
if (GUI::DragFloat("m_fShadowMiddleBoxRatio", &fFar, 0.001f, 0.001f, 0.999f, "%.3f")) {
|
||||
bModified = true;
|
||||
}
|
||||
//if (GUI::DragFloat("m_fSafe_RadiusMultiplier", &fSafe_RadiusMultiplier, 0.01f, 1.f, 3.f, "%.3f")) {
|
||||
// bModified = true;
|
||||
//}
|
||||
//if (GUI::DragFloat("m_fSafe_RadiusMargin", &fSafe_RadiusMargin, 1.f, 10.f, 40.f, "%.3f")) {
|
||||
// bModified = true;
|
||||
//}
|
||||
if (GUI::DragFloat4("ShadowBiasNMFS", (_float*)&vShadowBias, 0.0001f, 0.0001f, 1.f, "%.4f")) {
|
||||
bModified = true;
|
||||
}
|
||||
@@ -592,11 +608,11 @@ void CPipeLine::Describe_Entity()
|
||||
m_vShadowRadius = vShadowRadius;
|
||||
m_fSafe_RadiusMultiplier = fSafe_RadiusMultiplier;
|
||||
m_fSafe_RadiusMargin = fSafe_RadiusMargin;
|
||||
m_vShadowBoxMarginMin = vShadowBoxMarginMin;
|
||||
m_vShadowBoxMarginMax = vShadowBoxMarginMax;
|
||||
m_vShadowMarginMin = vShadowBoxMarginMin;
|
||||
m_vShadowMarginMax = vShadowBoxMarginMax;
|
||||
}
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
@@ -605,7 +605,7 @@ void CRenderTarget_Manager::RenderTarget_Debuger()
|
||||
GUI::DragInt("Target Size Y", &m_iSizeY);
|
||||
GUI::PopItemWidth();
|
||||
ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar;
|
||||
GUI::BeginChild("RTDebugger", { 120.f, 200.f }, ImGuiChildFlags_None, window_flags);
|
||||
GUI::BeginChild("RTDebugger", { 200.f, 200.f }, ImGuiChildFlags_None, window_flags);
|
||||
for (auto& [key, pRenderTarget] : m_RenderTargets)
|
||||
{
|
||||
_string strKey = CMyTools::ToString(key);
|
||||
|
||||
@@ -17,7 +17,7 @@ void CRenderer::Render()
|
||||
Render_LightAcc();
|
||||
Render_Combined();
|
||||
Render_Occlusion();
|
||||
Render_EnvironmentPostProcess();
|
||||
//Render_EnvironmentPostProcess();
|
||||
Render_Fog();
|
||||
Render_Blur();
|
||||
Combine_Blur();
|
||||
@@ -48,13 +48,13 @@ void CRenderer::Render()
|
||||
GUI::Begin("RenderTarget Debuger", 0, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
GUI::Checkbox("DebugToggle", &m_bToggleDebug);
|
||||
|
||||
if (m_bToggleDebug) {
|
||||
Render_Debug();
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_F10)) {
|
||||
Render_Debug();
|
||||
}
|
||||
else if (m_bToggleDebug) {
|
||||
Render_Debug();
|
||||
}
|
||||
#endif
|
||||
m_eType = RENDER::END;
|
||||
@@ -107,6 +107,22 @@ void CRenderer::Render_PreShadow(const _float4x4& ViewMatrix, const _float4x4& P
|
||||
}
|
||||
|
||||
m_pContext->RSSetViewports(iNumViewOldPort, &ViewPortOldDesc);
|
||||
|
||||
#ifdef DEBUG_SHADOW
|
||||
if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_PreShadow_DEBUG"), m_pPreShadowDSV))) {
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_PreShadow"), m_pShader, "g_VelocityTexture"))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::DEBUG_RtoRGBA));
|
||||
m_pVIBuffer->Bind_Resources();
|
||||
m_pVIBuffer->Render();
|
||||
if (FAILED(m_pGameInstance->End_MRT())) {
|
||||
return;
|
||||
}
|
||||
#endif // DEBUG_SHADOW
|
||||
}
|
||||
|
||||
HRESULT CRenderer::Bind_PreShadowMatrix(class CShader* pShader, const _char* pConstants, D3DTS eType)
|
||||
@@ -170,6 +186,9 @@ void CRenderer::Bind_RawValue()
|
||||
if (FAILED(m_pShader->Bind_RawValue("g_vPreShadowResolution", &m_vPreShadowResoltion, sizeof(_float2)))) {
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pShader->Bind_RawValue("g_bUsePhongShader", &m_bUsePhongShader, sizeof(_bool)))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CRenderer::Render_Occlusion()
|
||||
@@ -234,6 +253,10 @@ void CRenderer::Render_Shadow()
|
||||
{
|
||||
COMPUTE_TIMEDELTA("Timer_Render_Shadow");
|
||||
EVENTSCOPE_("Render_Shadow");
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
m_ShadowNearBreakdown.Reset();
|
||||
m_ShadowMiddleBreakdown.Reset();
|
||||
#endif
|
||||
D3D11_VIEWPORT ViewPortOldDesc;
|
||||
_uint iNumViewOldPort = { 1 };
|
||||
ZeroMemory(&ViewPortOldDesc, sizeof(D3D11_VIEWPORT));
|
||||
@@ -273,7 +296,11 @@ void CRenderer::Render_Shadow()
|
||||
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_NEAR)]) {
|
||||
if (nullptr != pRenderObject) {
|
||||
if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_NEAR))) {
|
||||
const _bool bRenderSuccess = SUCCEEDED(pRenderObject->Render_Shadow(SHADOW::SHADOW_NEAR));
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
Collect_RenderBreakdown(m_ShadowNearBreakdown, pRenderObject, bRenderSuccess);
|
||||
#endif
|
||||
if (false == bRenderSuccess) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
@@ -307,7 +334,11 @@ void CRenderer::Render_Shadow()
|
||||
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_MIDDLE)]) {
|
||||
if (nullptr != pRenderObject) {
|
||||
if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_MIDDLE))) {
|
||||
const _bool bRenderSuccess = SUCCEEDED(pRenderObject->Render_Shadow(SHADOW::SHADOW_MIDDLE));
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
Collect_RenderBreakdown(m_ShadowMiddleBreakdown, pRenderObject, bRenderSuccess);
|
||||
#endif
|
||||
if (false == bRenderSuccess) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
@@ -323,6 +354,26 @@ void CRenderer::Render_Shadow()
|
||||
}
|
||||
m_pContext->RSSetViewports(iNumViewOldPort, &ViewPortOldDesc);
|
||||
|
||||
#ifdef DEBUG_SHADOW
|
||||
if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Shadow_DEBUG"), m_pPreShadowDSV))) {
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Shadow_Near"), m_pShader, "g_VelocityTexture"))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Shadow_Middle"), m_pShader, "g_TileVelocityTexture"))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::DEBUG_RtoRGBA));
|
||||
m_pVIBuffer->Bind_Resources();
|
||||
m_pVIBuffer->Render();
|
||||
if (FAILED(m_pGameInstance->End_MRT())) {
|
||||
return;
|
||||
}
|
||||
#endif // DEBUG_SHADOW
|
||||
|
||||
COMPUTE_TIMEDELTA("Timer_Render_Shadow");
|
||||
}
|
||||
|
||||
@@ -331,6 +382,9 @@ void CRenderer::Render_NonBlend()
|
||||
COMPUTE_TIMEDELTA("Timer_Render_NonBlend");
|
||||
EVENTSCOPE_("Render_NonBlend");
|
||||
m_eType = RENDER::NONBLEND;
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
m_NonBlendBreakdown.Reset();
|
||||
#endif
|
||||
|
||||
if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_GameObjects")))) {
|
||||
return;
|
||||
@@ -339,7 +393,11 @@ void CRenderer::Render_NonBlend()
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::NONBLEND)])
|
||||
{
|
||||
if (nullptr != pRenderObject) {
|
||||
if (FAILED(pRenderObject->Render())) {
|
||||
const _bool bRenderSuccess = SUCCEEDED(pRenderObject->Render());
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
Collect_RenderBreakdown(m_NonBlendBreakdown, pRenderObject, bRenderSuccess);
|
||||
#endif
|
||||
if (false == bRenderSuccess) {
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
@@ -354,6 +412,72 @@ void CRenderer::Render_NonBlend()
|
||||
COMPUTE_TIMEDELTA("Timer_Render_NonBlend");
|
||||
}
|
||||
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
void CRenderer::Collect_RenderBreakdown(RENDER_PASS_BREAKDOWN& Breakdown, CGameObject* pRenderObject, _bool bRenderResult)
|
||||
{
|
||||
if (nullptr == pRenderObject) {
|
||||
return;
|
||||
}
|
||||
|
||||
++Breakdown.iObjectCount;
|
||||
if (false == bRenderResult) {
|
||||
++Breakdown.iRenderFailCount;
|
||||
}
|
||||
|
||||
const _uint iObjectTag = pRenderObject->Get_ObjectTag();
|
||||
++Breakdown.ObjectTagCounts[iObjectTag];
|
||||
|
||||
const _string strTypeName = typeid(*pRenderObject).name();
|
||||
++Breakdown.ObjectTypeCounts[strTypeName];
|
||||
}
|
||||
|
||||
void CRenderer::Draw_RenderBreakdown(const _char* pTitle, const RENDER_PASS_BREAKDOWN& Breakdown, _uint iTopN)
|
||||
{
|
||||
if (nullptr == pTitle) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GUI::TreeNode(pTitle))
|
||||
{
|
||||
GUI::Text("Objects: %u / Fail: %u", Breakdown.iObjectCount, Breakdown.iRenderFailCount);
|
||||
|
||||
if (GUI::TreeNode("Top Object Types"))
|
||||
{
|
||||
vector<pair<_string, _uint>> TypeCounts(
|
||||
Breakdown.ObjectTypeCounts.begin(), Breakdown.ObjectTypeCounts.end());
|
||||
sort(TypeCounts.begin(), TypeCounts.end(),
|
||||
[](const pair<_string, _uint>& Left, const pair<_string, _uint>& Right) {
|
||||
return Left.second > Right.second;
|
||||
});
|
||||
|
||||
const _uint iMaxCount = min<_uint>(iTopN, (_uint)TypeCounts.size());
|
||||
for (_uint i = 0; i < iMaxCount; ++i) {
|
||||
GUI::Text("%u) %s : %u", i + 1, TypeCounts[i].first.c_str(), TypeCounts[i].second);
|
||||
}
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
if (GUI::TreeNode("Top Object Tags"))
|
||||
{
|
||||
vector<pair<_uint, _uint>> TagCounts(
|
||||
Breakdown.ObjectTagCounts.begin(), Breakdown.ObjectTagCounts.end());
|
||||
sort(TagCounts.begin(), TagCounts.end(),
|
||||
[](const pair<_uint, _uint>& Left, const pair<_uint, _uint>& Right) {
|
||||
return Left.second > Right.second;
|
||||
});
|
||||
|
||||
const _uint iMaxCount = min<_uint>(iTopN, (_uint)TagCounts.size());
|
||||
for (_uint i = 0; i < iMaxCount; ++i) {
|
||||
GUI::Text("%u) Tag[%u] : %u", i + 1, TagCounts[i].first, TagCounts[i].second);
|
||||
}
|
||||
GUI::TreePop();
|
||||
}
|
||||
|
||||
GUI::TreePop();
|
||||
}
|
||||
}
|
||||
#endif // RELEASE_DEBUGGER
|
||||
|
||||
void CRenderer::Render_Decal()
|
||||
{
|
||||
m_pGameInstance->Copy_RenderTargetAToB(TEXT("Target_Normal"), TEXT("Target_NormalCopy"));
|
||||
@@ -991,6 +1115,25 @@ void CRenderer::Render_SSAO_BLUR()
|
||||
if (FAILED(m_pGameInstance->End_MRT())) {
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG_SSAO
|
||||
if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_SSAO_BLUR_DEBUG")))) {
|
||||
assert(false); return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_SSAO_AmbientOcclusion"), m_pShader, "g_VelocityTexture"))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_SSAO_BLUR"), m_pShader, "g_TileVelocityTexture"))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::DEBUG_RtoRGBA));
|
||||
m_pVIBuffer->Bind_Resources();
|
||||
m_pVIBuffer->Render();
|
||||
if (FAILED(m_pGameInstance->End_MRT())) {
|
||||
return;
|
||||
}
|
||||
#endif // DEBUG_SSAO
|
||||
COMPUTE_TIMEDELTA("Timer_Render_SSAO_BLUR");
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,23 @@ HRESULT CRenderer::Initialize()
|
||||
DXGI_FORMAT_R16_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_SHADOW
|
||||
/* Target_Shadow_Near */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Near_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Target_Shadow_Middle */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Shadow_Middle_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Target_PreShadow */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_PreShadow_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // DEBUG_SHADOW
|
||||
|
||||
/* Target_Blur */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_Blur"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
@@ -232,7 +249,6 @@ HRESULT CRenderer::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/* Target_ENV_Blur_X */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_ENV_Blur_X"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) {
|
||||
@@ -258,6 +274,18 @@ HRESULT CRenderer::Initialize()
|
||||
DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_SSAO
|
||||
/* Target_SSAO_AmbientOcclusion */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO_AmbientOcclusion_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Target_SSAO_BLUR */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO_BLUR_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(1.f, 1.f, 1.f, 1.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif //DEBUG_SSAO
|
||||
|
||||
/* Target_AfterCombined */
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_AfterCombined"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
@@ -362,14 +390,16 @@ HRESULT CRenderer::Initialize()
|
||||
DXGI_FORMAT_R32G32_FLOAT, _float4(0.5f, 0.5f, 0.f, 0.f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_MOTIONBLUR
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_VelocityMap_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(0.5f, 0.5f, 0.5f, 0.f)))) {
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(0.5f, 0.5f, 0.5f, 0.5f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_VelocityTent_DEBUG"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(0.5f, 0.5f, 0.5f, 0.f)))) {
|
||||
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, _float4(0.5f, 0.5f, 0.5f, 0.5f)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // DEBUG_MOTIONBLUR
|
||||
if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_BeforeNormal"), (_uint)Viewport.Width, (_uint)Viewport.Height,
|
||||
DXGI_FORMAT_R16G16B16A16_UNORM, _float4(0.0f, 0.f, 0.f, 0.f)))) {
|
||||
return E_FAIL;
|
||||
@@ -436,6 +466,14 @@ HRESULT CRenderer::Initialize()
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_BLUR"), TEXT("Target_SSAO_BLUR")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_SSAO
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_BLUR_DEBUG"), TEXT("Target_SSAO_AmbientOcclusion_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_BLUR_DEBUG"), TEXT("Target_SSAO_BLUR_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // DEBUG_SSAO
|
||||
/* MRT_Combined */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Combined"), TEXT("Target_Fog")))) {
|
||||
return E_FAIL;
|
||||
@@ -464,11 +502,28 @@ HRESULT CRenderer::Initialize()
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Shadow_Middle"), TEXT("Target_Shadow_Middle")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_SHADOW
|
||||
/* MRT_Shadow */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Shadow_DEBUG"), TEXT("Target_Shadow_Near_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* MRT_Shadow_Middle */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Shadow_DEBUG"), TEXT("Target_Shadow_Middle_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // DEBUG_SHADOW
|
||||
|
||||
|
||||
/* MRT_PreShadow */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_PreShadow"), TEXT("Target_PreShadow")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_SHADOW
|
||||
/* MRT_PreShadow */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_PreShadow_DEBUG"), TEXT("Target_PreShadow_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // DEBUG_SHADOW
|
||||
|
||||
/* MRT_Blur */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Blur"), TEXT("Target_Blur")))) {
|
||||
@@ -533,12 +588,15 @@ HRESULT CRenderer::Initialize()
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_MotionBlur"), TEXT("Target_VelocityMapFinal")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef DEBUG_MOTIONBLUR
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_MotionBlur_DEBUG"), TEXT("Target_VelocityMap_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_MotionBlur_DEBUG"), TEXT("Target_VelocityTent_DEBUG")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // DEBUG_MOTIONBLUR
|
||||
|
||||
|
||||
|
||||
/* MRT_Blur_Mesh */
|
||||
@@ -657,11 +715,17 @@ void CRenderer::Free()
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
void CRenderer::Describe_Entitiy()
|
||||
{
|
||||
GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
static _bool bShowGUIWindow = true;
|
||||
GUI::Begin("SYSTEM", &bShowGUIWindow, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
if (GUI::CollapsingHeader("RENDERER")) {
|
||||
if (GUI::CollapsingHeader("Variable")) {
|
||||
GUI::DragFloat("SpecularMaximum", &m_fLightSpecularMaximum, 0.01f, 0.0f, 2.f, "%.3f");
|
||||
GUI::DragFloat("fMinShadowBrightness", &m_fMinShadowBrightness, 0.01f, 0.0f, 1.f, "%.3f");
|
||||
GUI::Checkbox("UsePhongShader", &m_bUsePhongShader);
|
||||
_float fDepthOcclusionThreshold = m_pGameInstance->Get_DepthOcclusionThreshold();
|
||||
if (GUI::SliderFloat("DepthOcclusionThreshold", &fDepthOcclusionThreshold, 15.f, 150.f, "%.1f")) {
|
||||
m_pGameInstance->Set_DepthOcclusionThreshold(fDepthOcclusionThreshold);
|
||||
}
|
||||
}
|
||||
if (GUI::CollapsingHeader("PostProcessing_Bloom"))
|
||||
{
|
||||
@@ -670,34 +734,11 @@ void CRenderer::Describe_Entitiy()
|
||||
GUI::SliderInt("g_iEmbossingPass", &m_iBloomEmbossingPass, 0, 2, "%d");
|
||||
GUI::EndChild();
|
||||
}
|
||||
if (GUI::CollapsingHeader("Environment DOF"))
|
||||
{
|
||||
GUI::BeginChild("DOF_ENV", ImVec2(0, 0), true);
|
||||
|
||||
GUI::Text("Far DOF (Environment)");
|
||||
GUI::Separator();
|
||||
|
||||
GUI::DragFloat("Depth Cut", &m_fDOF_ENV_CutThreshold, 0.001f, 0.0f, 20.0f, "%.4f");
|
||||
GUI::DragFloat("Focus Dist", &m_fDOF_ENV_FocusDistance, 1.0f, 0.1f, 125.f, "%.1f");
|
||||
GUI::DragFloat("Blur Start", &m_fDOF_ENV_StartDistance, 1.0f, 0.1f, 250.f, "%.1f");
|
||||
GUI::DragFloat("Blur End", &m_fDOF_ENV_MaxEnd, 1.0f, 1.0f, 500.f, "%.1f");
|
||||
GUI::DragFloat("Max Radius", &m_fDOF_ENV_AmountRadius, 0.1f, 0.0f, 10.0f, "%.2f");
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (m_fDOF_ENV_StartDistance < m_fDOF_ENV_FocusDistance) {
|
||||
m_fDOF_ENV_StartDistance = m_fDOF_ENV_FocusDistance;
|
||||
}
|
||||
if (m_fDOF_ENV_MaxEnd < m_fDOF_ENV_StartDistance + 1.0f) {
|
||||
m_fDOF_ENV_MaxEnd = m_fDOF_ENV_StartDistance + 1.0f;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
GUI::EndChild();
|
||||
}
|
||||
if (GUI::CollapsingHeader("SSAO")) {
|
||||
GUI::BeginChild("SSAO_Setting", ImVec2(0, 0), true);
|
||||
GUI::DragFloat("fSSAORadius ", &m_fSSAO_Radius, 0.001f, -3.f, 3.f, "%.5f");
|
||||
GUI::DragFloat("fSSAO_BIAS", &m_fSSAO_BIAS, 0.001f, -2.f, 2.f, "%.5f");
|
||||
GUI::DragFloat("fSSAOStrength", &m_fSSAOStrength, 0.01f, 1.f, 4.f, "%.5f");
|
||||
GUI::DragFloat("fSSAO_BIAS", &m_fSSAO_BIAS, 0.001f, 0.01f, 2.f, "%.5f");
|
||||
GUI::DragFloat("fSSAOStrength", &m_fSSAOStrength, 0.01f, 0.01f, 4.f, "%.5f");
|
||||
GUI::EndChild();
|
||||
}
|
||||
if (GUI::CollapsingHeader("ToneMapping")) {
|
||||
@@ -712,7 +753,15 @@ void CRenderer::Describe_Entitiy()
|
||||
GUI::SliderFloat("m_fMBMaxBlurRadius", &m_fMBMaxBlurRadius, 0.1f, (_float)m_iMBMaxSampleCount, "%.1f");
|
||||
GUI::SliderInt("g_iMBSampleCount", &m_iMBSampleCount, 0, m_iMBMaxSampleCount, "%d");
|
||||
}
|
||||
if (GUI::CollapsingHeader("End_Padding")) {
|
||||
if (GUI::CollapsingHeader("Render_Breakdown"))
|
||||
{
|
||||
GUI::Checkbox("Show Breakdown", &m_bShowRenderBreakdown);
|
||||
if (m_bShowRenderBreakdown)
|
||||
{
|
||||
Draw_RenderBreakdown("NonBlend", m_NonBlendBreakdown, 10);
|
||||
Draw_RenderBreakdown("Shadow_Near", m_ShadowNearBreakdown, 10);
|
||||
Draw_RenderBreakdown("Shadow_Middle", m_ShadowMiddleBreakdown, 10);
|
||||
}
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (GUI::Button("Refresh_Shader")) {
|
||||
|
||||
@@ -394,7 +394,7 @@ HRESULT CRigidBody_Dynamic::Initialize(void* pArg)
|
||||
m_tagData.pOwner = m_pOwner;
|
||||
XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix());
|
||||
m_tagData.pBody = this;
|
||||
m_tagData.bAutoOwnerTranslation = pDesc->bAutoOwnerTranslation;
|
||||
m_tagData.bAutoTranslation = pDesc->bAutoTranslation;
|
||||
m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this, m_pGameInstance->Get_NextLevelID());
|
||||
m_pRigidBody->setCMassLocalPose(m_PxMassCenter);
|
||||
m_pRigidBody->setRigidDynamicLockFlags(m_eLockFlag);
|
||||
|
||||
@@ -46,7 +46,6 @@ HRESULT CTimer_Manager::Add_Timer(const _wstring& strTimerTag)
|
||||
|
||||
HRESULT CTimer_Manager::Initialize()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(Add_Timer(TEXT("Timer_Render_Priority")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -107,7 +106,6 @@ HRESULT CTimer_Manager::Initialize()
|
||||
if (FAILED(Add_Timer(TEXT("Timer_Render_UI_Overley")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -276,32 +276,32 @@ void CTransform::Translation(_fvector vTrans)
|
||||
Set_State(STATE::POSITION, Get_State(STATE::POSITION) + XMVectorSetW(vTrans, 0.f));
|
||||
}
|
||||
|
||||
void CTransform::AccumulateMomentum(_fvector vMomentum)
|
||||
void CTransform::AccumulateVelocity(_fvector vVelocity)
|
||||
{
|
||||
XMStoreFloat3(&m_vMomentum, (XMLoadFloat3(&m_vMomentum) + XMVectorSetW(vMomentum, 0.f)));
|
||||
XMStoreFloat3(&m_vVelocityVector, (XMLoadFloat3(&m_vVelocityVector) + XMVectorSetW(vVelocity, 0.f)));
|
||||
}
|
||||
_vector CTransform::Get_CurrentMomentum() const
|
||||
void CTransform::ResetVelocityVector()
|
||||
{
|
||||
return XMLoadFloat3(&m_vMomentum);
|
||||
}
|
||||
void CTransform::Set_CurrentMomentum(_fvector vMomentum)
|
||||
{
|
||||
XMStoreFloat3(&m_vMomentum, vMomentum);
|
||||
}
|
||||
_vector CTransform::Get_EstimatedPositionByMomentum() const
|
||||
{
|
||||
return XMVectorSetW(Get_State(STATE::POSITION) + XMLoadFloat3(&m_vMomentum), 1.f);
|
||||
}
|
||||
void CTransform::RewindMomentum()
|
||||
{
|
||||
m_vMomentum = m_vBackMomentum;
|
||||
m_vBackMomentum = { 0.f, 0.f, 0.f };
|
||||
m_vVelocityVector = m_vBackVelocityVector;
|
||||
m_vBackVelocityVector = { 0.f, 0.f, 0.f };
|
||||
m_PrevMatrix = m_WorldMatrix;
|
||||
}
|
||||
|
||||
void CTransform::BookMomentum(_fvector vMomentum)
|
||||
_vector CTransform::Get_CurrentVelocity() const
|
||||
{
|
||||
XMStoreFloat3(&m_vBackMomentum, (XMLoadFloat3(&m_vBackMomentum) + XMVectorSetW(vMomentum, 0.f)));
|
||||
return XMLoadFloat3(&m_vVelocityVector);
|
||||
}
|
||||
void CTransform::Set_CurrentVelocity(_fvector vVelocity)
|
||||
{
|
||||
XMStoreFloat3(&m_vVelocityVector, vVelocity);
|
||||
}
|
||||
_vector CTransform::Get_EstimatedPositionByVelocityVector() const
|
||||
{
|
||||
return XMVectorSetW(Get_State(STATE::POSITION) + XMLoadFloat3(&m_vVelocityVector), 1.f);
|
||||
}
|
||||
|
||||
void CTransform::BookVelocity(_fvector vVelocity)
|
||||
{
|
||||
XMStoreFloat3(&m_vBackVelocityVector, (XMLoadFloat3(&m_vBackVelocityVector) + XMVectorSetW(vVelocity, 0.f)));
|
||||
}
|
||||
|
||||
void CTransform::Turn(_fvector vAxis, _float fTimeDelta)
|
||||
@@ -640,9 +640,13 @@ void TransformXMLInput(CTransform* pTransform)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // _DEBUG
|
||||
#ifdef RELEASE_DEBUGGER
|
||||
|
||||
void CTransform::Describe_Entity()
|
||||
{
|
||||
//#ifdef 기무리
|
||||
#ifdef _DEBUG
|
||||
if (GUI::TreeNode("NuriDebug")) {
|
||||
{
|
||||
_vector vScale, vRotQ, vTrans;
|
||||
@@ -652,6 +656,7 @@ void CTransform::Describe_Entity()
|
||||
XMStoreFloat4(&rotQ, vRotQ);
|
||||
XMStoreFloat4(&trans, vTrans);
|
||||
TransformXMLInput(this);
|
||||
|
||||
if (GUI::SmallButton("Copy")) {
|
||||
_char buf[512] = {};
|
||||
sprintf_s(
|
||||
@@ -671,7 +676,7 @@ void CTransform::Describe_Entity()
|
||||
}
|
||||
GUI::TreePop();
|
||||
}
|
||||
//#endif // 기무리
|
||||
#endif _DEBUG
|
||||
if (GUI::TreeNode("Transform")) {
|
||||
GUI::Text("----- Gizmo ----");
|
||||
_float3 vMove = {};
|
||||
@@ -699,19 +704,17 @@ void CTransform::Describe_Entity()
|
||||
GUI::InputFloat("Y##Rotation", &m_vRotation.y, 1.f, 15.f);
|
||||
GUI::InputFloat("Z##Rotation", &m_vRotation.z, 1.f, 15.f);
|
||||
|
||||
#ifndef 기무리
|
||||
Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
#endif // 기무리
|
||||
#ifdef 기무리
|
||||
_float3 vRot = {};
|
||||
XMStoreFloat3(&vRot, Get_RollPitchYawVector());
|
||||
GUI::Text("R : %.2f", XMConvertToDegrees(vRot.x)); GUI::SameLine();
|
||||
GUI::Text("\tY : %.2f", XMConvertToDegrees(vRot.y)); GUI::SameLine();
|
||||
GUI::Text("\tP : %.2f", XMConvertToDegrees(vRot.z));
|
||||
if (GUI::SmallButton("ApplyRotation")) {
|
||||
Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
}
|
||||
#endif // 기무리
|
||||
//#ifdef 기무리
|
||||
// _float3 vRot = {};
|
||||
// XMStoreFloat3(&vRot, Get_RollPitchYawVector());
|
||||
// GUI::Text("R : %.2f", XMConvertToDegrees(vRot.x)); GUI::SameLine();
|
||||
// GUI::Text("\tY : %.2f", XMConvertToDegrees(vRot.y)); GUI::SameLine();
|
||||
// GUI::Text("\tP : %.2f", XMConvertToDegrees(vRot.z));
|
||||
// if (GUI::SmallButton("ApplyRotation")) {
|
||||
// Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
// }
|
||||
//#endif // 기무리
|
||||
|
||||
|
||||
_float3 vScale = Get_Scale();
|
||||
@@ -730,8 +733,7 @@ void CTransform::Describe_Entity()
|
||||
GUI::TreePop();
|
||||
GUI::Spacing();
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
#endif
|
||||
|
||||
@@ -313,8 +313,12 @@ STATEANIM::ESTATE CUnit::StringToStateAnim(const string& s)
|
||||
{ "IDLE_TURN_BWD", IDLE_TURN_BWD },
|
||||
{ "IDLE_COMBAT_TURN_BWD_L", IDLE_COMBAT_TURN_BWD_L },
|
||||
{ "IDLE_COMBAT_TURN_BWD_R", IDLE_COMBAT_TURN_BWD_R },
|
||||
{ "IDLE_COMBAT_TURN_45_L", IDLE_COMBAT_TURN_45_L },
|
||||
{ "IDLE_COMBAT_TURN_45_R", IDLE_COMBAT_TURN_45_R },
|
||||
{ "IDLE_COMBAT_TURN_90_L", IDLE_COMBAT_TURN_90_L },
|
||||
{ "IDLE_COMBAT_TURN_90_R", IDLE_COMBAT_TURN_90_R },
|
||||
{ "IDLE_COMBAT_TURN_135_L", IDLE_COMBAT_TURN_135_L },
|
||||
{ "IDLE_COMBAT_TURN_135_R", IDLE_COMBAT_TURN_135_R },
|
||||
{ "IDLE_COMBAT_RUSH_TURN_BWD_R", IDLE_COMBAT_RUSH_TURN_BWD_R },
|
||||
{ "IDLE_COMBAT_RUSH_TURN_BWD_L", IDLE_COMBAT_RUSH_TURN_BWD_L },
|
||||
{ "IDLE_BREAK1", IDLE_BREAK1 }, { "IDLE_BREAK2", IDLE_BREAK2 },
|
||||
|
||||
@@ -256,24 +256,34 @@ void CVolumetric::Free()
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
//#ifdef _DEBUG
|
||||
|
||||
void CVolumetric::Describe_Entity()
|
||||
{
|
||||
_bool open = true;
|
||||
GUI::Begin("SYSTEM", &open, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
if (GUI::CollapsingHeader("VOLUMETRIC")) {
|
||||
GUI::SliderFloat("Density", &m_fDensity,0.001f, 5.f);
|
||||
GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.00f, 0.5f, "%.4f");
|
||||
GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, -0.9f, 0.9f, "%.4f");
|
||||
GUI::SliderFloat("DepthPackExponent", &m_fDepthPackExponent, 0.01f, 5.f);
|
||||
GUI::SliderFloat("HieghtOffset", &m_fHeightOffset, 0.f, 1.f, "%.5f");
|
||||
GUI::InputFloat("BaseHeight", &m_fBaseHeight, 0.1f, 1.f);
|
||||
}
|
||||
GUI::End();
|
||||
//GUI::Begin("SYSTEM", &open, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
//if (GUI::CollapsingHeader("VOLUMETRIC")) {
|
||||
// GUI::SliderFloat("Density", &m_fDensity,0.001f, 5.f);
|
||||
// GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.00f, 0.5f, "%.4f");
|
||||
// GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, -0.9f, 0.9f, "%.4f");
|
||||
// GUI::SliderFloat("DepthPackExponent", &m_fDepthPackExponent, 0.01f, 5.f);
|
||||
// GUI::SliderFloat("HieghtOffset", &m_fHeightOffset, 0.f, 1.f, "%.5f");
|
||||
// GUI::InputFloat("BaseHeight", &m_fBaseHeight, 0.1f, 1.f);
|
||||
//}
|
||||
//GUI::End();
|
||||
GUI::Begin("VOLUMETRIC");
|
||||
|
||||
|
||||
GUI::SliderFloat("Density", &m_fDensity, 0.001f, 5.f);
|
||||
GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.00f, 0.5f, "%.4f");
|
||||
GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, -0.9f, 0.9f, "%.4f");
|
||||
GUI::SliderFloat("DepthPackExponent", &m_fDepthPackExponent, 0.01f, 5.f);
|
||||
GUI::SliderFloat("HieghtOffset", &m_fHeightOffset, 0.f, 1.f, "%.5f");
|
||||
GUI::InputFloat("BaseHeight", &m_fBaseHeight, 0.1f, 1.f);
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
//#endif // _DEBUG
|
||||
|
||||
HRESULT CVolumetric::CreateComputeShader()
|
||||
{
|
||||
|
||||
@@ -1560,7 +1560,7 @@ static void DemoWindowWidgetsDragAndDrop()
|
||||
};
|
||||
static int mode = 0;
|
||||
if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine();
|
||||
if (ImGui::RadioButton("AccumulateMomentum", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
|
||||
if (ImGui::RadioButton("AccumulateVelocity", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine();
|
||||
if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; }
|
||||
static const char* names[9] =
|
||||
{
|
||||
@@ -1584,7 +1584,7 @@ static void DemoWindowWidgetsDragAndDrop()
|
||||
// Display preview (could be anything, e.g. when dragging an image we could decide to display
|
||||
// the filename and a small preview of the image, etc.)
|
||||
if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); }
|
||||
if (mode == Mode_Move) { ImGui::Text("AccumulateMomentum %s", names[n]); }
|
||||
if (mode == Mode_Move) { ImGui::Text("AccumulateVelocity %s", names[n]); }
|
||||
if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
|
||||
ImGui::EndDragDropSource();
|
||||
}
|
||||
|
||||
@@ -57,7 +57,8 @@ enum class SHADER_PASS_CELL { DEBUG, END };
|
||||
|
||||
enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT,
|
||||
UPSAMPLE, BLOOM_BLURX, BLOOM_BLURY, EMBOSSING, BLOOM_ACCUM, BLOOM_FINISH, BLURX_ENVIRONMENT,
|
||||
POSTCOMBINED, FOG, TONE_MAPPING, SSAO_OCCLUSION, SSAO_BLUR, MOTIONBLUR, DOWNSAMPLE, MOTIONBLURTILE, MOTIONBLURTENT, PRINT_BACKBUFFER, DEBUG_MOTIONBLUR_INTENSE,
|
||||
POSTCOMBINED, FOG, TONE_MAPPING, SSAO_OCCLUSION, SSAO_BLUR, MOTIONBLUR, DOWNSAMPLE, MOTIONBLURTILE, MOTIONBLURTENT, PRINT_BACKBUFFER,
|
||||
DEBUG_MOTIONBLUR_INTENSE, DEBUG_RtoRGBA,
|
||||
END };
|
||||
|
||||
enum class SHADER_PASS_BLUR { BLUR_X , BLUR_Y , COMBINED, END};
|
||||
@@ -127,14 +128,6 @@ enum class PHYSX_KIND {
|
||||
OBSTACLEActor,
|
||||
};
|
||||
|
||||
enum class PHYSX_JOINT {
|
||||
D6,
|
||||
DISTANCE,
|
||||
REVOLUTE,
|
||||
FIXED,
|
||||
END
|
||||
};
|
||||
|
||||
enum class PXOBJECT : _uint {
|
||||
#pragma region NOT_DEFINE
|
||||
NOT_DEFINE = 0,
|
||||
@@ -239,6 +232,14 @@ enum class PXOBJECT : _uint {
|
||||
END = 999
|
||||
};
|
||||
|
||||
enum class PHYSX_JOINT {
|
||||
D6,
|
||||
DISTANCE,
|
||||
REVOLUTE,
|
||||
FIXED,
|
||||
END
|
||||
};
|
||||
|
||||
enum class HIT_TYPE
|
||||
{
|
||||
HIT_NONE = 0, // 히트모션 없음
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define GUI ImGui
|
||||
#endif // !GUI
|
||||
#ifndef IMGUI_GLOBAL_BEGIN_FLAG
|
||||
#define IMGUI_GLOBAL_BEGIN_FLAG ImGuiWindowFlags_NoFocusOnAppearing|ImGuiWindowFlags_NoBringToFrontOnFocus|ImGuiWindowFlags_AlwaysAutoResize
|
||||
#define IMGUI_GLOBAL_BEGIN_FLAG ImGuiWindowFlags_NoFocusOnAppearing|ImGuiWindowFlags_NoBringToFrontOnFocus
|
||||
#endif // IMGUI_GLOBAL_BEGIN_FLAG
|
||||
#define COMPUTE_TIMEDELTA(TIMER) m_pGameInstance->Compute_TimeDelta(TEXT(TIMER))
|
||||
|
||||
@@ -22,7 +22,12 @@
|
||||
#define RELEASE_DEBUGGER
|
||||
#endif // !_DEBUG
|
||||
|
||||
#define DEBUG_MOTIONBLUR
|
||||
//#ifdef 기무리
|
||||
//#define DEBUG_MOTIONBLUR
|
||||
//#define DEBUG_SSAO
|
||||
//#define DEBUG_SHADOW
|
||||
//#define DEBUG_CAMERAS
|
||||
//#endif // 기무리
|
||||
|
||||
|
||||
|
||||
@@ -146,11 +151,11 @@
|
||||
#define MRO_PARAMETER 2.f/ 27.f
|
||||
#define SRO_PARAMETER 15.f/ 27.f
|
||||
|
||||
constexpr unsigned int g_iNearShadowWidth = 4096;
|
||||
constexpr unsigned int g_iNearShadowHeight = 4096;
|
||||
constexpr unsigned int g_iNearShadowWidth = 8192;
|
||||
constexpr unsigned int g_iNearShadowHeight = 8192;
|
||||
|
||||
constexpr unsigned int g_iMiddleShadowWidth = 2048;
|
||||
constexpr unsigned int g_iMiddleShadowHeight = 2048;
|
||||
constexpr unsigned int g_iMiddleShadowWidth = 4096;
|
||||
constexpr unsigned int g_iMiddleShadowHeight = 4096;
|
||||
|
||||
constexpr unsigned int g_iFarShadowWidth = 1024;
|
||||
constexpr unsigned int g_iFarShadowHeight = 1024;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user