From 0b7e06a5e312d5828333b5e461af3858a526758c Mon Sep 17 00:00:00 2001 From: GiJungSUk Date: Tue, 16 Dec 2025 16:58:07 +0900 Subject: [PATCH] commit --- Jusin154_Team3D/Client/Private/Accio.cpp | 4 +- Jusin154_Team3D/Client/Private/Broom.cpp | 19 ++++- Jusin154_Team3D/Client/Public/Broom.h | 4 +- .../Resources/Data/Effect/ScreenFX/Wind.bin | 4 +- .../ShaderFiles/Shader_VtxModelInstance.hlsl | 83 ++++++++++++------- 5 files changed, 77 insertions(+), 37 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Accio.cpp b/Jusin154_Team3D/Client/Private/Accio.cpp index ce69aa8ce..c26740f72 100644 --- a/Jusin154_Team3D/Client/Private/Accio.cpp +++ b/Jusin154_Team3D/Client/Private/Accio.cpp @@ -184,7 +184,9 @@ HRESULT CAccio::Pre_Setting(CGameObject* pObject, void* pArg) _vector vStartPos = WandPos; XMStoreFloat4(&m_vStartPos, vStartPos); - _matrix WandWorld = pPlayer->Get_WandPos(); + _matrix WandWorld = XMMatrixIdentity(); + + WandWorld.r[3] = pPlayer->Get_WandPos().r[3]; XMStoreFloat4x4(&m_TrailWorld , WandWorld); diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index 0dc3c5af3..9b427fc5d 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -60,9 +60,12 @@ HRESULT CBroom::Initialize(void* pArg) return E_FAIL; } + m_pWindEffect->Get_Effect_Info()->isBillboard = false; } + + return S_OK; } @@ -115,7 +118,7 @@ void CBroom::Update(_float fTimeDelta) { if (m_fSpeed <= 5.f) { - m_pWindEffect->Set_Visible(false); + //m_pWindEffect->Set_Visible(false); return; } @@ -137,16 +140,24 @@ void CBroom::Late_Update(_float fTimeDelta) { CTransform* WindTransform = m_pWindEffect->Get_Component(); - _matrix WorldMat = m_pTransformCom->Get_XMWorldMatrix() * XMMatrixRotationAxis(WindTransform->Get_State(STATE::UP) , XMConvertToRadians(180.f)); + _matrix WorldMat = m_pTransformCom->Get_XMWorldMatrix()/* * XMMatrixRotationAxis(XMVectorSet(0.f , 1.f, 0.f ,0.f), XMConvertToRadians(180.f))*/; WindTransform->Set_WorldMatrix(WorldMat); - WindTransform->Set_State(STATE::POSITION, m_pGameInstance->Get_CamXMPosition()); + _vector vCameraLook = XMVector3Normalize(m_pGameInstance->Get_CameraLook()); + WindTransform->Set_State(STATE::POSITION, m_pGameInstance->Get_CamXMPosition() + vCameraLook * m_fCameraOffset + XMVectorSet(0.f ,m_fYOffset , 0.f ,0.f)); + +#if _DEBUG +#if 진우 GUI::Begin("Wind"); m_pWindEffect->Get_Component()->Describe_Entity(); - + GUI::Checkbox("BillBoard", &m_pWindEffect->Get_Effect_Info()->isBillboard); + GUI::DragFloat("Offset", &m_fCameraOffset); + GUI::DragFloat("Offset Y", &m_fYOffset); GUI::End(); } +#endif +#endif m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); diff --git a/Jusin154_Team3D/Client/Public/Broom.h b/Jusin154_Team3D/Client/Public/Broom.h index d6df1bfb2..adbc15591 100644 --- a/Jusin154_Team3D/Client/Public/Broom.h +++ b/Jusin154_Team3D/Client/Public/Broom.h @@ -74,6 +74,8 @@ class CBroom final : public CUnit BroomInput m_Input; class CEffectParts* m_pWindEffect = { nullptr }; + _float m_fCameraOffset = { -10.f }; + _float m_fYOffset= { -5.f }; private: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); @@ -97,7 +99,7 @@ class CBroom final : public CUnit _float m_fAmount = { 1.f }; _float m_fInputTime = {}; _bool m_bRatio = { false }; - + HRESULT InputAction(); HRESULT InputMove(); HRESULT InputKeyUpMove(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ScreenFX/Wind.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ScreenFX/Wind.bin index 25a2b36bf..24f971bee 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ScreenFX/Wind.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/ScreenFX/Wind.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97d9ac3fd881002ef55820c9f7a6267310cc8a691fc456d1473531cb17fd86bf -size 1084 +oid sha256:621033b2bae53361347bc874097141eac07edb5a97b890594f6c61eb30ed5df6 +size 1094 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 36b4b758a..09cef3616 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -557,21 +557,7 @@ float4 DrawEffect(PS_IN In) discard; } - /* 소프트 이펙트 */ - - float2 vTexcoord; - - vTexcoord.x = In.vProjPos.x / In.vProjPos.w * 0.5f + 0.5f; - vTexcoord.y = In.vProjPos.y / In.vProjPos.w * -0.5f + 0.5f; - - float4 vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vTexcoord); - - float fOldViewZ = vDepthDesc.y * g_fFar; - - float fDistance = fOldViewZ - In.vProjPos.w; - - vMtrlDiffuse.a = vMtrlDiffuse.a * saturate(fDistance); - + return vMtrlDiffuse; } @@ -681,6 +667,28 @@ float4 RimLight(PS_IN In) return vRimLight; } +float4 SoftEffect(PS_IN In, float4 vMtrlDiffuse) +{ + /* 소프트 이펙트 */ + + float4 vDiffuse = vMtrlDiffuse; + + float2 vTexcoord; + + vTexcoord.x = In.vProjPos.x / In.vProjPos.w * 0.5f + 0.5f; + vTexcoord.y = In.vProjPos.y / In.vProjPos.w * -0.5f + 0.5f; + + float4 vDepthDesc = g_DepthTexture.Sample(DefaultSampler, vTexcoord); + + float fOldViewZ = vDepthDesc.y * g_fFar; + + float fDistance = fOldViewZ - In.vProjPos.w; + + vDiffuse.a = vDiffuse.a * saturate(fDistance); + + return vDiffuse; + +} PS_OUT PS_MAIN(PS_IN In) { @@ -689,10 +697,12 @@ PS_OUT PS_MAIN(PS_IN In) vMtrlDiffuse = DrawEffect(In); + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); + vMtrlDiffuse.rgb += EmissiveDraw(In, vMtrlDiffuse).rgb; vMtrlDiffuse.rgb += RimLight(In).rgb; - + Out.vDiffuse = vMtrlDiffuse; return Out; @@ -706,6 +716,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMtrlDiffuse = DrawEffect(In); + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); + int2 iTexel = int2(In.vPosition.xy); float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; @@ -790,7 +802,8 @@ PS_BLUR_OUT PS_BLUR_NOEMISSIVE(PS_IN In) vMtrlDiffuse = DrawEffect(In); - //// 색깔 추가할 처리 (이미시브) + //// 색깔 추가할 처리 (이미시브) + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); vMtrlDiffuse.a *= 5.f; @@ -811,6 +824,8 @@ PS_BLUR_OUT PS_BLUR(PS_IN In) vMtrlDiffuse = DrawEffect(In); + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); + vMtrlDiffuse.a *= 5.f; vMtrlDiffuse.a = saturate(vMtrlDiffuse.a); @@ -834,6 +849,7 @@ PS_BLOOM_OUT PS_BLOOM(PS_IN In) vMtrlDiffuse = DrawEffect(In); + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); //// 색깔 추가할 처리 (이미시브) @@ -869,6 +885,8 @@ PS_BLOOM_OUT PS_BLEND(PS_IN In) vMtrlDiffuse = DrawEffect(In); + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); + vMtrlDiffuse.rgb += EmissiveDraw(In, vMtrlDiffuse).rgb; vMtrlDiffuse += RimLight(In); @@ -886,6 +904,8 @@ PS_BLOOM_OUT PS_WEIGHTED_FOR_BLEND(PS_IN In) vMtrlDiffuse = DrawEffect(In); + vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); + vMtrlDiffuse.rgb += EmissiveDraw(In, vMtrlDiffuse).rgb; vMtrlDiffuse += RimLight(In); @@ -915,6 +935,7 @@ PS_OUT PS_NO_DEPTH_COMPARE(PS_IN In) technique11 DefaultTechnique { +//0 pass Model { SetRasterizerState(RS_Default); @@ -924,7 +945,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } - +//1 pass NON_NOMALMAP { SetRasterizerState(RS_Nocull); @@ -934,7 +955,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); } - +//2 pass Blur { SetRasterizerState(RS_Nocull); @@ -944,7 +965,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_BLUR(); } - +//3 pass WEIGHTBLEND { SetRasterizerState(RS_Nocull); @@ -954,7 +975,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); } - +//4 pass NO_WORLD { SetRasterizerState(RS_Nocull); @@ -964,7 +985,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); } - +//5 pass BLUR_NO_WORLD { SetRasterizerState(RS_Nocull); @@ -975,7 +996,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLUR(); } - + //6 pass BLEND { SetRasterizerState(RS_Nocull); @@ -985,7 +1006,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_BLEND(); } - +//7 pass BLEND_NOWORLD { SetRasterizerState(RS_Nocull); @@ -995,7 +1016,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_BLEND(); } - +//8 pass BLOOM { SetRasterizerState(RS_Nocull); @@ -1005,7 +1026,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_BLOOM(); } - +//9 pass BLOOM_NOWORLD { SetRasterizerState(RS_Nocull); @@ -1016,7 +1037,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLOOM(); } - +//10 pass BLUR_NO_EMMISVE { SetRasterizerState(RS_Nocull); @@ -1027,6 +1048,8 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLUR_NOEMISSIVE(); } +//11 + pass BLUR_NO_WORLD_NO_EMISSIVE { SetRasterizerState(RS_Nocull); @@ -1037,6 +1060,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLUR_NOEMISSIVE(); } +//12 pass WEIGHTBLEND_FOR_BLEND { SetRasterizerState(RS_Nocull); @@ -1048,7 +1072,7 @@ technique11 DefaultTechnique } - +//13 pass PARTICLE_DEPTH_STOP { SetRasterizerState(RS_Nocull); @@ -1059,7 +1083,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_MAIN(); } - +//14 pass WB_CULLING { SetRasterizerState(RS_Default); @@ -1070,6 +1094,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); } +//15 pass SCREEN_FX { SetRasterizerState(RS_Nocull);