From 137e1ebb54183de2c9f00a77fff2f65ea2a2f0d1 Mon Sep 17 00:00:00 2001 From: GiJungSUk Date: Sat, 15 Nov 2025 22:04:24 +0900 Subject: [PATCH] 251115 --- .../ShaderFiles/Engine_Shader_Defines.hlsli | 46 ++++++++++ .../ShaderFiles/Shader_Particle_Compute.hlsl | 2 +- .../ShaderFiles/Shader_VtxModelInstance.hlsl | 58 ++++++++++-- .../ShaderFiles/Shader_VtxPosTex.hlsl | 5 ++ .../Editor/Bin/Resources/Data/Effect/1.bin | Bin 0 -> 435 bytes .../Editor/Bin/Resources/Data/Effect/2.bin | Bin 0 -> 528 bytes .../Bin/Resources/Data/Effect/LumosTest.bin | Bin 583 -> 583 bytes .../ShaderFiles/Engine_Shader_Defines.hlsli | 46 ++++++++++ .../ShaderFiles/Shader_Particle_Compute.hlsl | 2 +- .../ShaderFiles/Shader_VtxModelInstance.hlsl | 84 +++++++++++++++--- .../ShaderFiles/Shader_VtxPosTex.hlsl | 5 ++ .../ShaderFiles/Shader_WeightBlend.hlsl | 75 ++++++++++++++++ .../Editor/Private/EffectObject.cpp | 17 +++- .../Editor/Private/Effect_Editor.cpp | 2 + Jusin154_Team3D/Editor/Public/EffectObject.h | 1 - .../ShaderFiles/Engine_Shader_Defines.hlsli | 46 ++++++++++ .../ShaderFiles/Shader_Particle_Compute.hlsl | 2 +- .../ShaderFiles/Shader_WeightBlend.hlsl | 75 ++++++++++++++++ Jusin154_Team3D/Engine/Default/Engine.vcxproj | 4 + .../Engine/Default/Engine.vcxproj.filters | 3 + .../Engine/Private/GameInstance.cpp | 10 +++ .../Engine/Private/Graphic_Device.cpp | 33 ++++++- .../Engine/Private/Prototype_Manager.cpp | 9 +- .../Engine/Private/RenderTarget_Manager.cpp | 29 +++++- Jusin154_Team3D/Engine/Private/Renderer.cpp | 51 +++++++++-- Jusin154_Team3D/Engine/Public/GameInstance.h | 2 + .../Engine/Public/Graphic_Device.h | 6 +- .../Engine/Public/RenderTarget_Manager.h | 5 +- Jusin154_Team3D/Engine/Public/Renderer.h | 10 +-- 29 files changed, 578 insertions(+), 50 deletions(-) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/1.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/2.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl create mode 100644 Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli index e8137283d..dfebe9a1b 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli @@ -157,6 +157,52 @@ BlendState BS_UIBlend RenderTargetWriteMask[0] = 0x0F; // RGBA 모두 출력 }; +BlendState BS_WB_Acc +{ + BlendEnable[0] = true; + BlendEnable[1] = true; + BlendEnable[2] = true; + BlendEnable[3] = true; + BlendEnable[4] = true; + BlendEnable[5] = true; + BlendEnable[6] = true; + BlendEnable[7] = true; + + SrcBlend[0] = one; + DestBlend[0] = one; + BlendOp[0] = Add; + + SrcBlend[1] = Zero; + DestBlend[1] = Inv_Src_Alpha; + BlendOp[1] = Add; + + + SrcBlend[2] = one; + DestBlend[2] = one; + BlendOp[2] = Add; +}; + +BlendState BS_WeightBlend +{ + BlendEnable[0] = true; + BlendEnable[1] = true; + BlendEnable[2] = true; + BlendEnable[3] = true; + BlendEnable[4] = true; + BlendEnable[5] = true; + BlendEnable[6] = true; + BlendEnable[7] = true; + + + SrcBlend[0] = Inv_Src_Alpha; + DestBlend[0] = Src_Alpha; + + BlendOp[0] = Add; + + + +}; + float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vShadowMapSize, float bias) { float2 uv = float2(vLightClip.x / vLightClip.w, -vLightClip.y / vLightClip.w) * 0.5f + 0.5f; diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 29225605d..30af64c2a 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -99,7 +99,7 @@ void CS_MAIN( } particle.vLifeTime.x = 0.f; - particle.vTranslation.y = 0.f; + } Billboard(particle); diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index da2552728..0e6bd801c 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -114,7 +114,6 @@ float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption) } - struct VS_IN { float3 vPosition : POSITION; @@ -188,9 +187,45 @@ struct PS_IN struct PS_OUT { float4 vDiffuse : SV_TARGET0; - float4 vColorTarget : SV_TARGET1; + float4 vRevealage : SV_TARGET1; + float4 vColorTarget : SV_TARGET2; }; + +PS_OUT BlendedWeight(vector fDiffuse, float fLinearZ) +{ + PS_OUT Out; + + + + float3 vColor = fDiffuse.rgb; + float fAlpha = fDiffuse.a; + + + float fWeight = +max( + min(1.0, max(max(vColor.r, vColor.g), vColor.b) * fAlpha), + fAlpha +) * +clamp( + 0.03 / (1e-4 + pow(fLinearZ / 200, 4.0)), + 1e-2, 3e3 +); + + + //float fWeight = clamp(0.03f / (1e-5 + pow(fLinearZ, 4.0f)), 0.01, 3e3); + //fWeight = max(fWeight, 1.0); + //이게 오리지널 웨이트 함수 + + //float fWeight = pow(fLinearZ, -2.5); + //float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f); + + Out.vDiffuse = vector(vColor.rgb * fAlpha, fAlpha) * fWeight; + Out.vRevealage.r = fAlpha; + Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); + return Out; +} + PS_OUT PS_MAIN(PS_IN In) { @@ -228,7 +263,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vector vMtrlNoise; vector vMtrlDissolve; - float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; + float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime; float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; @@ -322,7 +357,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) discard; } - Out.vDiffuse = vMtrlDiffuse; + // 색깔 추가할 처리 (이미시브) @@ -332,12 +367,15 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) { vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); } + - if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha) - Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f); - else - Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); + Out = BlendedWeight(vMtrlDiffuse , In.vProjPos.w); + + //if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha) + // Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f); + //else + // Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); return Out; } @@ -528,7 +566,7 @@ technique11 DefaultTechnique { SetRasterizerState(RS_Nocull); SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); @@ -544,6 +582,8 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLUR(); } + + } diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl index 784af5a0e..6b9fcb9b8 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl @@ -98,6 +98,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } + pass ScissorPass { SetRasterizerState(RS_Scissor); @@ -107,6 +108,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } + pass UIPass { SetRasterizerState(RS_Nocull); @@ -116,6 +118,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } + pass UVMovePass { SetRasterizerState(RS_Nocull); @@ -125,6 +128,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_UVMove(); } + pass TrailPass { SetRasterizerState(RS_Nocull); @@ -134,4 +138,5 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Trail(); } + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/1.bin new file mode 100644 index 0000000000000000000000000000000000000000..32270174b86d0af2a4d3a94c5dafc19925f2d90e GIT binary patch literal 435 zcmZQzKn4x=$UN+9kQ!u+T@^@_@$A{NxMd+Sj9?1gJaj&)DQAEHCURi%pD#xshQNfN z^a@9q04I>a3dBI?oYjH~1{CF&#%3n67{p)z{%|yy literal 0 HcmV?d00001 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/2.bin new file mode 100644 index 0000000000000000000000000000000000000000..4f172f6209a125e2120e5646f0f0fa0440cb6440 GIT binary patch literal 528 zcmZQzKn4x=$UICoNFE(ys$ygWi!m~sJ$n{Yc7X%P49ysRTaX+?DYBU$QFJ~?3<1sn z0gQLy{}%6K5JO->PfFcgZYHEGS4VN-Rl@_YL-D(85sfnO9trn3oKc&QD3r zi4XRT_f0L%h!4m~%uCfXFfe4`2Wnwt0Qm>m&)C>dvq_=~fMIaLiGcw`qnqjAz`y{) IFmZ^%0IEM#(f|Me literal 0 HcmV?d00001 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LumosTest.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/LumosTest.bin index 7f16cc6b4c04a345b5796f16ec450dfe63584b15..783d2c484d48c749eadaeedcd89042816ce5ad99 100644 GIT binary patch delta 27 jcmX@ka-3zt0k(!~3?ep669q*!-m+(8I^i@~nn?!$i$4hd delta 27 jcmX@ka-3zt0k(n=R)21$iGm^ g_ParticleValue : register(t5); + +Texture2D g_EmissiveTexture : register(t6); +Texture2D g_DepthStencilTexture : register(t7); + + + float4 g_vCamPosition; vector g_vColor; @@ -70,7 +75,6 @@ bool g_isEmissive; bool g_isDiffuseUVMove; bool g_isMaskUVMove; -bool g_isBlendedWeight; float g_fFar; @@ -115,7 +119,6 @@ float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption) } - struct VS_IN { float3 vPosition : POSITION; @@ -189,9 +192,49 @@ struct PS_IN struct PS_OUT { float4 vDiffuse : SV_TARGET0; - float4 vColorTarget : SV_TARGET1; + float4 vRevealage : SV_TARGET1; + float4 vColorTarget : SV_TARGET2; }; + +PS_OUT BlendedWeight(vector fDiffuse, float fLinearZ , PS_IN In , float fProjZ) +{ + PS_OUT Out; + + + + float3 vColor = fDiffuse.rgb; + float fAlpha = fDiffuse.a; + + +// float fWeight = +//max( +// min(1.0, max(max(vColor.r, vColor.g), vColor.b) * fAlpha), +// fAlpha +//) * +//clamp( +// 0.01 / (1e-4 + pow(fLinearZ / 200, 4.0)), +// 0.01f, 1000 +//); + + + + float fWeight = clamp(0.03f / (1e-5 + pow(fLinearZ, 2.0f)), 0.01, 3e3); + fWeight = max(fWeight, 1.0); + + //이게 오리지널 웨이트 함수 + + //float fWeight = pow(fLinearZ, -2.5); + //float fWeight = clamp(pow(fLinearZ, -2.5f), 1.0f, 1000.0f); + + Out.vDiffuse = vector(vColor.rgb * fAlpha, fAlpha) * fWeight; + + + Out.vRevealage.a = fAlpha; + + return Out; +} + PS_OUT PS_MAIN(PS_IN In) { @@ -229,7 +272,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vector vMtrlNoise; vector vMtrlDissolve; - float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; + float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x; float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime; float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime; float2 vNoiseUVMoveTime = g_ParticleValue[In.iGPUIndex].vNoiseUVMoveTime; @@ -315,6 +358,9 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r); + if (vMtrlDiffuse.a <= 0.f) + discard; + if (g_isDissolve == true) { vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); @@ -323,7 +369,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) discard; } - Out.vDiffuse = vMtrlDiffuse; + // 색깔 추가할 처리 (이미시브) @@ -333,12 +379,24 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) { vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); } + + int2 texel = int2(In.vPosition.xy); - if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha) - Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f); - else - Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); + float fDepthStencilValue = g_DepthStencilTexture.Load(int3(texel, 0)); + + float bias = 0.0005f; + + if (fDepthStencilValue + bias < In.vProjPos.z / In.vProjPos.w) + discard; + + Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w, In, In.vProjPos.z / In.vProjPos.w); + + + //if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha) + // Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f); + //else + // Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f); return Out; } @@ -528,8 +586,8 @@ technique11 DefaultTechnique pass NON_NOMALMAP { SetRasterizerState(RS_Nocull); - SetDepthStencilState(DSS_Default, 0); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); @@ -545,6 +603,8 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLUR(); } + + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl index 784af5a0e..6b9fcb9b8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl @@ -98,6 +98,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } + pass ScissorPass { SetRasterizerState(RS_Scissor); @@ -107,6 +108,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } + pass UIPass { SetRasterizerState(RS_Nocull); @@ -116,6 +118,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN(); } + pass UVMovePass { SetRasterizerState(RS_Nocull); @@ -125,6 +128,7 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_UVMove(); } + pass TrailPass { SetRasterizerState(RS_Nocull); @@ -134,4 +138,5 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Trail(); } + } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl new file mode 100644 index 000000000..4774cd269 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl @@ -0,0 +1,75 @@ +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + + +Texture2D g_MixedDiffuseTexture; +Texture2D g_RevealageTexture; + +struct VS_IN +{ + float3 vPosition : POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct PS_OUT +{ + float4 vBackBuffer : SV_TARGET0; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + vector vMixedDiffuse = g_MixedDiffuseTexture.Sample(PointSampler, In.vTexcoord); + vector vRevealage = g_RevealageTexture.Sample(PointSampler, In.vTexcoord); + + if(vRevealage.b >= 1.f) + discard; + + Out.vBackBuffer = vector(vMixedDiffuse.rgb / max(vMixedDiffuse.a, 1e-5), 1 - vRevealage.r); + + + return Out; +} + +technique11 DefaultTechnique +{ + pass WeightBlend + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + +} diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 7b16e6b60..730a39ab5 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -40,6 +40,9 @@ HRESULT CEffectObject::Render() return E_FAIL; } + if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture"))) + return E_FAIL; + if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) return E_FAIL; @@ -48,8 +51,6 @@ HRESULT CEffectObject::Render() { return E_FAIL; } - - } return S_OK; @@ -97,6 +98,18 @@ HRESULT CEffectObject::Render_Blur() HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) { + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pNoise_TextureCom); + SAFE_RELEASE(m_pMasking_TextureCom); + SAFE_RELEASE(m_pDissolve_TextureCom); + SAFE_RELEASE(m_pEmissive_TextureCom); + + SAFE_RELEASE(m_pInstance_ModelCom); + + if (m_pLightCom != nullptr) + SAFE_RELEASE(m_pLightCom); + _string strPerfectFilePath = pFilePath; strPerfectFilePath += ".bin"; diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index ee746e3a3..6cdd68344 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -303,6 +303,7 @@ HRESULT CEffect_Editor::Load_Edit(const _char* pPath) if (m_pEditEffect == nullptr) return E_FAIL; + if (FAILED(m_pEditEffect->Load(pPath, LEVEL::EFFECT))) { @@ -404,6 +405,7 @@ void CEffect_Editor::Describe_Entity() return; + } ImGui::EndPopup(); diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index 608d849a9..84e8f287c 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -97,7 +97,6 @@ class CEffectObject abstract : public CPartObject _string m_strModelName = {}; _string m_strEmissiveName = {}; - _bool m_isBlendedWeight = {}; public: virtual void Free() override; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli index e8137283d..dfebe9a1b 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli @@ -157,6 +157,52 @@ BlendState BS_UIBlend RenderTargetWriteMask[0] = 0x0F; // RGBA 모두 출력 }; +BlendState BS_WB_Acc +{ + BlendEnable[0] = true; + BlendEnable[1] = true; + BlendEnable[2] = true; + BlendEnable[3] = true; + BlendEnable[4] = true; + BlendEnable[5] = true; + BlendEnable[6] = true; + BlendEnable[7] = true; + + SrcBlend[0] = one; + DestBlend[0] = one; + BlendOp[0] = Add; + + SrcBlend[1] = Zero; + DestBlend[1] = Inv_Src_Alpha; + BlendOp[1] = Add; + + + SrcBlend[2] = one; + DestBlend[2] = one; + BlendOp[2] = Add; +}; + +BlendState BS_WeightBlend +{ + BlendEnable[0] = true; + BlendEnable[1] = true; + BlendEnable[2] = true; + BlendEnable[3] = true; + BlendEnable[4] = true; + BlendEnable[5] = true; + BlendEnable[6] = true; + BlendEnable[7] = true; + + + SrcBlend[0] = Inv_Src_Alpha; + DestBlend[0] = Src_Alpha; + + BlendOp[0] = Add; + + + +}; + float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vShadowMapSize, float bias) { float2 uv = float2(vLightClip.x / vLightClip.w, -vLightClip.y / vLightClip.w) * 0.5f + 0.5f; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 29225605d..30af64c2a 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -99,7 +99,7 @@ void CS_MAIN( } particle.vLifeTime.x = 0.f; - particle.vTranslation.y = 0.f; + } Billboard(particle); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl new file mode 100644 index 000000000..4774cd269 --- /dev/null +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl @@ -0,0 +1,75 @@ +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + + +Texture2D g_MixedDiffuseTexture; +Texture2D g_RevealageTexture; + +struct VS_IN +{ + float3 vPosition : POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct PS_OUT +{ + float4 vBackBuffer : SV_TARGET0; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + vector vMixedDiffuse = g_MixedDiffuseTexture.Sample(PointSampler, In.vTexcoord); + vector vRevealage = g_RevealageTexture.Sample(PointSampler, In.vTexcoord); + + if(vRevealage.b >= 1.f) + discard; + + Out.vBackBuffer = vector(vMixedDiffuse.rgb / max(vMixedDiffuse.a, 1e-5), 1 - vRevealage.r); + + + return Out; +} + +technique11 DefaultTechnique +{ + pass WeightBlend + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + +} diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index 4ece1fa21..728131074 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -539,6 +539,10 @@ call Update_Lib.bat + + Effect + 5.0 + Effect 5.0 diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 86210937d..f2d773402 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -1128,5 +1128,8 @@ 99.Define\01.SHADER + + 99.Define\01.SHADER + \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 97d4e7c0f..d607289dd 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -226,6 +226,11 @@ void CGameInstance::Render_End() #endif // _DEBUG } +HRESULT CGameInstance::Bind_DepthStencil(CShader* pShader, const _char* pContantName) +{ + return m_pGraphic_Device->Bind_DepthStencil(pShader , pContantName); +} + _float CGameInstance::Get_TimeDelta(const _wstring& strTimerTag) { return m_pTimer_Manager->Get_TimeDelta(strTimerTag); @@ -485,6 +490,11 @@ HRESULT CGameInstance::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, I return m_pRenderTarget_Manager->Begin_MRT_Include_BackBuffer(strMRTTag, pDSV); } +HRESULT CGameInstance::Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag) +{ + return m_pRenderTarget_Manager->Begin_MRT_NO_DepthStencil(strMRTTag); +} + HRESULT CGameInstance::End_MRT() { return m_pRenderTarget_Manager->End_MRT(); diff --git a/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp b/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp index 43ee13950..6364a0419 100644 --- a/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp +++ b/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "Graphic_Device.h" +#include "Shader.h" CGraphic_Device::CGraphic_Device() : m_pDevice{ nullptr } @@ -83,6 +84,14 @@ HRESULT CGraphic_Device::Present() return m_pSwapChain->Present(0, 0); } +HRESULT CGraphic_Device::Bind_DepthStencil(CShader* pShader, const _char* pContantName) +{ + if (FAILED(pShader->Bind_SRV(pContantName, m_pDepthStencilSRV))) + return E_FAIL; + + return S_OK; +} + HRESULT CGraphic_Device::Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY) { @@ -172,20 +181,37 @@ HRESULT CGraphic_Device::Ready_DepthStencilView(_uint iWinCX, _uint iWinCY) TextureDesc.Height = iWinCY; TextureDesc.MipLevels = 1; TextureDesc.ArraySize = 1; - TextureDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + TextureDesc.Format = DXGI_FORMAT_R24G8_TYPELESS; TextureDesc.SampleDesc.Quality = 0; TextureDesc.SampleDesc.Count = 1; TextureDesc.Usage = D3D11_USAGE_DEFAULT; - TextureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + TextureDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE; TextureDesc.CPUAccessFlags = 0; TextureDesc.MiscFlags = 0; + if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &pDepthStencilTexture))) return E_FAIL; - if (FAILED(m_pDevice->CreateDepthStencilView(pDepthStencilTexture, nullptr, &m_pDepthStencilView))) + D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc = {}; + dsvDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + dsvDesc.Texture2D.MipSlice = 0; + + + if (FAILED(m_pDevice->CreateDepthStencilView(pDepthStencilTexture, &dsvDesc, &m_pDepthStencilView))) + return E_FAIL; + + /* DepthStencil SRV */ + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS; // 뎁스 샘플링용 + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; + srvDesc.Texture2D.MipLevels = 1; + srvDesc.Texture2D.MostDetailedMip = 0; + + if(FAILED(m_pDevice->CreateShaderResourceView(pDepthStencilTexture, &srvDesc, &m_pDepthStencilSRV))) return E_FAIL; SAFE_RELEASE(pDepthStencilTexture); @@ -212,6 +238,7 @@ void CGraphic_Device::Free() SAFE_RELEASE(m_pDepthStencilView); SAFE_RELEASE(m_pBackBufferRTV); SAFE_RELEASE(m_pDeviceContext); + SAFE_RELEASE(m_pDepthStencilSRV); #if defined(DEBUG) || defined(_DEBUG) ID3D11Debug* d3dDebug; diff --git a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp index e13552062..55a473d60 100644 --- a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Prototype_Manager.h" #include "GameObject.h" @@ -115,6 +115,13 @@ HRESULT CPrototype_Manager::Ready_EngineAssets() VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) { return E_FAIL; } + + if (FAILED(Add_Asset_Prototype(g_iStaticLevel, TEXT("FX_WEIGHTBELND"), + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_WeightBlend.hlsl"), + VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) { + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index e9b868d0c..00b50743d 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "RenderTarget_Manager.h" #include "RenderTarget.h" @@ -114,6 +114,33 @@ HRESULT CRenderTarget_Manager::Begin_MRT_Include_BackBuffer(const _wstring& strM return S_OK; } +HRESULT CRenderTarget_Manager::Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag) +{ + m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV); + + list* pMRTList = Find_MRT(strMRTTag); + + if (nullptr == pMRTList) + return E_FAIL; + + _uint iNumRenderTargets = { 0 }; + ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {}; + + m_pContext->OMSetRenderTargets(0, nullptr, nullptr); + + for (auto& pRenderTarget : *pMRTList) + { + pRenderTarget->Clear(); + pRenderTargetViews[iNumRenderTargets++] = pRenderTarget->Get_RTV(); + } + if (0 == iNumRenderTargets) { + return E_FAIL; + } + + m_pContext->OMSetRenderTargets(iNumRenderTargets, pRenderTargetViews, nullptr); + + return S_OK; +} HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D) { CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag); diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 3442d221b..949b72c55 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -111,6 +111,7 @@ void CRenderer::Render() Render_Blur(); Render_Combined(); Render_Effect(); + Render_WeightBlend(); Render_NonLight(); Render_Blend(); Render_LastColor(); @@ -317,10 +318,11 @@ void CRenderer::Render_Combined() void CRenderer::Render_Effect() { - if (FAILED(m_pGameInstance->Begin_MRT_Include_BackBuffer(TEXT("MRT_Color")))) { + if (FAILED(m_pGameInstance->Begin_MRT_NO_DepthStencil(TEXT("MRT_WB")))) { return; } + for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)]) { if (nullptr != pRenderObject) @@ -337,6 +339,30 @@ void CRenderer::Render_Effect() } } +void CRenderer::Render_WeightBlend() +{ + // Bind_Resorces + + m_pWeightBlendShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); + m_pWeightBlendShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); + m_pWeightBlendShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); + + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_WB_Color"), m_pWeightBlendShader, "g_MixedDiffuseTexture"))) { + return; + } + + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_WB_Revealage"), m_pWeightBlendShader, "g_RevealageTexture"))) { + return; + } + + m_pWeightBlendShader->Begin(0); + + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + +} + void CRenderer::Render_NonLight() { for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::NONLIGHT)]) @@ -464,9 +490,9 @@ void CRenderer::Render_LastColor() } -HRESULT CRenderer::Ready_DepthStencilView(_uint iSizeX, _uint iSizeY) +HRESULT CRenderer::Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY) { - ID3D11Texture2D* pDepthStencilTexture = nullptr; + ID3D11Texture2D* pShadowDepthStencilTexture = nullptr; D3D11_TEXTURE2D_DESC TextureDesc; ZeroMemory(&TextureDesc, sizeof(D3D11_TEXTURE2D_DESC)); @@ -485,16 +511,16 @@ HRESULT CRenderer::Ready_DepthStencilView(_uint iSizeX, _uint iSizeY) TextureDesc.CPUAccessFlags = 0; TextureDesc.MiscFlags = 0; - if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &pDepthStencilTexture))) { + if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &pShadowDepthStencilTexture))) { return E_FAIL; } - if (FAILED(m_pDevice->CreateDepthStencilView(pDepthStencilTexture, nullptr, &m_pShadowDSV))) { + if (FAILED(m_pDevice->CreateDepthStencilView(pShadowDepthStencilTexture, nullptr, &m_pShadowDSV))) { return E_FAIL; } - SAFE_RELEASE(pDepthStencilTexture); + SAFE_RELEASE(pShadowDepthStencilTexture); return S_OK; } @@ -608,19 +634,20 @@ HRESULT CRenderer::Initialize() /*WB_COLOR*/ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_WB_Color"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { + DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 1.0f)))) { return E_FAIL; } /* WB_A*/ if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_WB_Revealage"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.0f, 0.0f, 0.0f)))) { + DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(1.0f, 1.0f, 1.0f, 1.0f)))) { return E_FAIL; } - if (FAILED(Ready_DepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) { + + if (FAILED(Ready_ShadowDepthStencilView(g_iMaxShadowWidth, g_iMaxShadowHeight))) { return E_FAIL; } @@ -703,7 +730,12 @@ HRESULT CRenderer::Initialize() return E_FAIL; } + m_pWeightBlendShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("FX_WEIGHTBELND"), nullptr, nullptr); + if (nullptr == m_pWeightBlendShader) { + return E_FAIL; + } + m_pVIBuffer = CVIBuffer_Rect::Create(m_pDevice, m_pContext); if (nullptr == m_pVIBuffer) { return E_FAIL; @@ -752,6 +784,7 @@ void CRenderer::Free() SAFE_RELEASE(m_pShadowDSV); SAFE_RELEASE(m_pShader); SAFE_RELEASE(m_pLastColorShader); + SAFE_RELEASE(m_pWeightBlendShader); SAFE_RELEASE(m_pVIBuffer); SAFE_RELEASE(m_pDevice); SAFE_RELEASE(m_pContext); diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 7b2e7446e..af6e3258e 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -27,6 +27,7 @@ class ENGINE_DLL CGameInstance final : public CBase public: void Render_Begin(const _float4* pClearColor); void Render_End(); + HRESULT Bind_DepthStencil(class CShader* pShader, const _char* pContantName); #pragma endregion #pragma region TIMER_MANAGER @@ -149,6 +150,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr); + HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); diff --git a/Jusin154_Team3D/Engine/Public/Graphic_Device.h b/Jusin154_Team3D/Engine/Public/Graphic_Device.h index bcc42305a..c41bdacf7 100644 --- a/Jusin154_Team3D/Engine/Public/Graphic_Device.h +++ b/Jusin154_Team3D/Engine/Public/Graphic_Device.h @@ -20,6 +20,8 @@ class CGraphic_Device final HRESULT Present(); + HRESULT Bind_DepthStencil(class CShader* pShader, const _char* pContantName); + private: ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pDeviceContext = { nullptr }; @@ -27,7 +29,7 @@ class CGraphic_Device final IDXGISwapChain* m_pSwapChain = { nullptr }; ID3D11RenderTargetView* m_pBackBufferRTV = { nullptr }; ID3D11DepthStencilView* m_pDepthStencilView = { nullptr }; - + ID3D11ShaderResourceView* m_pDepthStencilSRV = { nullptr }; private: HRESULT Ready_SwapChain(HWND hWnd, _uint iWinCX, _uint iWinCY); HRESULT Ready_BackBufferRenderTargetView(); @@ -38,4 +40,4 @@ class CGraphic_Device final virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 53416cb62..24baa3dd0 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" NS_BEGIN(Engine) @@ -14,6 +14,7 @@ class CRenderTarget_Manager final : public CBase HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey); HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV); + HRESULT Begin_MRT_NO_DepthStencil(const _wstring& strMRTTag); HRESULT End_MRT(); HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName); HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D); @@ -48,4 +49,4 @@ class CRenderTarget_Manager final : public CBase virtual void Free()override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 1a2be66ad..8fafc8a56 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -32,6 +32,7 @@ class CRenderer final : public CBase private: class CShader* m_pShader = { nullptr }; class CShader* m_pLastColorShader = { nullptr }; + class CShader* m_pWeightBlendShader = { nullptr }; class CVIBuffer_Rect* m_pVIBuffer = { nullptr }; private: @@ -59,6 +60,7 @@ class CRenderer final : public CBase void Render_Blur(); void Render_Combined(); void Render_Effect(); + void Render_WeightBlend(); void Render_NonLight(); void Render_Blend(); void Render_LastColor(); @@ -71,9 +73,7 @@ class CRenderer final : public CBase #endif private: - HRESULT Ready_DepthStencilView(_uint iSizeX, _uint iSizeY); - - + HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY); private: HRESULT Initialize(); @@ -82,4 +82,4 @@ class CRenderer final : public CBase virtual void Free(); }; -NS_END \ No newline at end of file +NS_END