From 52389d808720170fe42a4f15b128c186640db04b Mon Sep 17 00:00:00 2001 From: kimnuri Date: Fri, 19 Dec 2025 01:27:59 +0900 Subject: [PATCH] =?UTF-8?q?[add]=20=EB=AA=A8=EC=85=98=20=EB=B8=94=EB=9F=AC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(=20=EB=B0=A9=ED=96=A5=EC=84=B1?= =?UTF-8?q?=EC=9D=80=20=EC=95=84=EC=A7=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShaderFiles/Engine_Shader_Functions.hlsli | 27 ++++++---- .../ShaderFiles/Shader_Deferred.hlsl | 53 ++++++++++++------- .../ShaderFiles/Engine_Shader_Functions.hlsli | 27 ++++++---- .../ShaderFiles/Shader_Deferred.hlsl | 53 ++++++++++++------- Jusin154_Team3D/Engine/Private/Renderer.cpp | 3 ++ .../Engine/Private/Renderer_Declare.cpp | 4 +- Jusin154_Team3D/Engine/Public/Renderer.h | 7 +-- 7 files changed, 111 insertions(+), 63 deletions(-) diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index d1b3f1c7f..75d7484e7 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -231,7 +231,7 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv) // BackGround ForeGround 합은 1 float2 DepthCompare(float fCenterDepth, float fSampleDepth, float fDepthScale) { - return saturate(0.5f + float2(fDepthScale, -fDepthScale) * (fSampleDepth - fCenterDepth)); + return saturate(0.5f + 0.5f + 0.5f*(float2(fDepthScale, -fDepthScale) * (fSampleDepth - fCenterDepth))); } float2 SpreadCompare(float fOffsetLength, float2 fSpreadLength, float fPixelToSampleUnitsScale) @@ -468,20 +468,25 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex return lerp(vDiffuseA, vDiffuseBlendColor, fRatio); } - -float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos) +float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f) { - if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) { - return float2(0.0f, 0.0f); + if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) + { + return float2(0.5f, 0.5f); } - float2 currentUV = (vCurrentProjPos.xy/vCurrentProjPos.w); - float2 previousUV = (vPreviousProjPos.xy / vCurrentProjPos.w); + float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w; + float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w; - currentUV.y *= -1.f; - previousUV.y *= -1.f; - - return (currentUV - previousUV) * 0.5f + 0.5f; + currentNDC.y *= -1.f; + previousNDC.y *= -1.f; + + // 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 } float3 DownSampleFast(Texture2D SrcTexture2D, float2 vCenterTexcoord, float2 vSrcTexelSize, float2 vResolution) diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 553916aa3..3ef93b2c9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -75,6 +75,7 @@ Texture2D g_ColorTexture; Texture2D g_VelocityTexture; int g_iMBSampleCount; +int g_iMBMaxSampleCount; float g_fMBBlurRadius; int g_iMBType; float g_fMBSampleBias; @@ -233,8 +234,9 @@ struct PS_OUT_SSAO_BLUR // g_fFar // g_fMBSampleBias // g_fMBBlurRadius -// g_iMBType // g_iMBSampleCount +// g_iMBMaxSampleCount +// g_iMBType PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) { PS_OUT_VELOCITYBLUR Out = (PS_OUT_VELOCITYBLUR) 0; @@ -249,12 +251,12 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) float fSampleSpreadLength; float2 uv = In.vTexcoord; - float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y * g_fFar; // 해당 셀의 깊이 - float2 vCenterVelocityUV = g_VelocityTexture.Sample(PointSampler, uv).xy; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y; // 해당 셀의 깊이 + float2 vCenterVelocityUV = (g_VelocityTexture.Sample(PointSampler, uv).xy * 2.f - 1.f); float2 vCenterVelocityPixels = vCenterVelocityUV * g_vResolution.xy; // UV -> 픽셀 float fCenterSpreadLength = clamp(abs(vCenterVelocityPixels.x), 0.0f, g_fMBBlurRadius); float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); // 소스 셀 사이즈 g_vResolution-> 현재는 colortexture 해상도 - int iMaxMotionBlurSampleCount = min(g_iMBSampleCount, 7); /* 최대 속도 */ + int iMaxMotionBlurSampleCount = min(g_iMBSampleCount, g_iMBMaxSampleCount); /* 최대 속도 */ float fPixelToSampleUnitsScale = (float) iMaxMotionBlurSampleCount / max(g_fMBBlurRadius, FLT_EPSILON5); float fDepthScale = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5); @@ -273,8 +275,8 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) continue; } - fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y * g_fFar; - vSampledVelocityUV = g_VelocityTexture.Sample(PointSampler, vDestUV).xy; + fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y; + vSampledVelocityUV = (g_VelocityTexture.Sample(PointSampler, vDestUV).xy * 2.f - 1.f); vSampledVelocityPixels = vSampledVelocityUV * g_vResolution.xy; fSampleSpreadLength = clamp(abs(vSampledVelocityPixels.x), 0.0f, g_fMBBlurRadius); @@ -296,9 +298,17 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) float fTapCount = (float) (2 * iMaxMotionBlurSampleCount + 1); float fCoverage = saturate(fWeight / max(fTapCount, 1.0f)); - Out.vColor = float4(vBlurColor.rgb, fCoverage); - //Out.vColor = vBlurColor; - Out.vVelocity = vBlurVelocity; + //Out.vColor = float4(vBlurColor.rgb, fCoverage); + Out.vColor = vBlurColor; + Out.vVelocity = vBlurVelocity * 0.5f + 0.5f; + float2 vBlurVelocityPixels = vBlurVelocity * g_vResolution.xy; + if (length(vBlurVelocityPixels) < 0.5f) // 0.5px 이하면 정지 취급 + { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, uv); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } + return Out; } PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) @@ -315,8 +325,8 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) float fSampleSpreadLength; float2 uv = In.vTexcoord; - float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y * g_fFar; // 해당 셀의 깊이 - float2 vCenterVelocityUV = g_VelocityTexture.Sample(PointSampler, uv).xy; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y; // 해당 셀의 깊이 + float2 vCenterVelocityUV = (g_VelocityTexture.Sample(PointSampler, uv).xy * 2.f - 1.f); float2 vCenterVelocityPixels = vCenterVelocityUV * g_vResolution.xy; // UV -> 픽셀 float fCenterSpreadLength = clamp(abs(vCenterVelocityPixels.y), 0.0f, g_fMBBlurRadius); float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); // 소스 셀 사이즈 g_vResolution-> 현재는 colortexture 해상도 @@ -339,15 +349,14 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) continue; } - fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y * g_fFar; - vSampledVelocityUV = g_VelocityTexture.Sample(PointSampler, vDestUV).xy; + fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y; + vSampledVelocityUV = (g_VelocityTexture.Sample(PointSampler, vDestUV).xy * 2.f - 1.f); vSampledVelocityPixels = vSampledVelocityUV * g_vResolution.xy; fSampleSpreadLength = clamp(abs(vSampledVelocityPixels.y), 0.0f, g_fMBBlurRadius); // [Sample] float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, float(abs(i)), fCenterSpreadLength, fSampleSpreadLength, fPixelToSampleUnitsScale, fDepthScale); - if (fWeightCalculated <= 0.0f) - { + if (fWeightCalculated <= 0.0f) { continue; } vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vDestUV); @@ -362,9 +371,17 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) float fTapCount = (float) (2 * iMaxMotionBlurSampleCount + 1); float fCoverage = saturate(fWeight / max(fTapCount, 1.0f)); - Out.vColor = float4(vBlurColor.rgb, fCoverage); - //Out.vColor = vBlurColor; - Out.vVelocity = vBlurVelocity; + //Out.vColor = float4(vBlurColor.rgb, fCoverage); + Out.vColor = vBlurColor; + Out.vVelocity = vBlurVelocity * 0.5f + 0.5f; + float2 vBlurVelocityPixels = vBlurVelocity * g_vResolution.xy; + if (length(vBlurVelocityPixels) < 0.5f) // 0.5px 이하면 정지 취급 + { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, uv); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } + return Out; } PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index d1b3f1c7f..75d7484e7 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -231,7 +231,7 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv) // BackGround ForeGround 합은 1 float2 DepthCompare(float fCenterDepth, float fSampleDepth, float fDepthScale) { - return saturate(0.5f + float2(fDepthScale, -fDepthScale) * (fSampleDepth - fCenterDepth)); + return saturate(0.5f + 0.5f + 0.5f*(float2(fDepthScale, -fDepthScale) * (fSampleDepth - fCenterDepth))); } float2 SpreadCompare(float fOffsetLength, float2 fSpreadLength, float fPixelToSampleUnitsScale) @@ -468,20 +468,25 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex return lerp(vDiffuseA, vDiffuseBlendColor, fRatio); } - -float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos) +float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f) { - if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) { - return float2(0.0f, 0.0f); + if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) + { + return float2(0.5f, 0.5f); } - float2 currentUV = (vCurrentProjPos.xy/vCurrentProjPos.w); - float2 previousUV = (vPreviousProjPos.xy / vCurrentProjPos.w); + float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w; + float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w; - currentUV.y *= -1.f; - previousUV.y *= -1.f; - - return (currentUV - previousUV) * 0.5f + 0.5f; + currentNDC.y *= -1.f; + previousNDC.y *= -1.f; + + // 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 } float3 DownSampleFast(Texture2D SrcTexture2D, float2 vCenterTexcoord, float2 vSrcTexelSize, float2 vResolution) diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 553916aa3..3ef93b2c9 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -75,6 +75,7 @@ Texture2D g_ColorTexture; Texture2D g_VelocityTexture; int g_iMBSampleCount; +int g_iMBMaxSampleCount; float g_fMBBlurRadius; int g_iMBType; float g_fMBSampleBias; @@ -233,8 +234,9 @@ struct PS_OUT_SSAO_BLUR // g_fFar // g_fMBSampleBias // g_fMBBlurRadius -// g_iMBType // g_iMBSampleCount +// g_iMBMaxSampleCount +// g_iMBType PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) { PS_OUT_VELOCITYBLUR Out = (PS_OUT_VELOCITYBLUR) 0; @@ -249,12 +251,12 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) float fSampleSpreadLength; float2 uv = In.vTexcoord; - float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y * g_fFar; // 해당 셀의 깊이 - float2 vCenterVelocityUV = g_VelocityTexture.Sample(PointSampler, uv).xy; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y; // 해당 셀의 깊이 + float2 vCenterVelocityUV = (g_VelocityTexture.Sample(PointSampler, uv).xy * 2.f - 1.f); float2 vCenterVelocityPixels = vCenterVelocityUV * g_vResolution.xy; // UV -> 픽셀 float fCenterSpreadLength = clamp(abs(vCenterVelocityPixels.x), 0.0f, g_fMBBlurRadius); float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); // 소스 셀 사이즈 g_vResolution-> 현재는 colortexture 해상도 - int iMaxMotionBlurSampleCount = min(g_iMBSampleCount, 7); /* 최대 속도 */ + int iMaxMotionBlurSampleCount = min(g_iMBSampleCount, g_iMBMaxSampleCount); /* 최대 속도 */ float fPixelToSampleUnitsScale = (float) iMaxMotionBlurSampleCount / max(g_fMBBlurRadius, FLT_EPSILON5); float fDepthScale = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5); @@ -273,8 +275,8 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) continue; } - fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y * g_fFar; - vSampledVelocityUV = g_VelocityTexture.Sample(PointSampler, vDestUV).xy; + fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y; + vSampledVelocityUV = (g_VelocityTexture.Sample(PointSampler, vDestUV).xy * 2.f - 1.f); vSampledVelocityPixels = vSampledVelocityUV * g_vResolution.xy; fSampleSpreadLength = clamp(abs(vSampledVelocityPixels.x), 0.0f, g_fMBBlurRadius); @@ -296,9 +298,17 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURX(PS_IN In) float fTapCount = (float) (2 * iMaxMotionBlurSampleCount + 1); float fCoverage = saturate(fWeight / max(fTapCount, 1.0f)); - Out.vColor = float4(vBlurColor.rgb, fCoverage); - //Out.vColor = vBlurColor; - Out.vVelocity = vBlurVelocity; + //Out.vColor = float4(vBlurColor.rgb, fCoverage); + Out.vColor = vBlurColor; + Out.vVelocity = vBlurVelocity * 0.5f + 0.5f; + float2 vBlurVelocityPixels = vBlurVelocity * g_vResolution.xy; + if (length(vBlurVelocityPixels) < 0.5f) // 0.5px 이하면 정지 취급 + { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, uv); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } + return Out; } PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) @@ -315,8 +325,8 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) float fSampleSpreadLength; float2 uv = In.vTexcoord; - float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y * g_fFar; // 해당 셀의 깊이 - float2 vCenterVelocityUV = g_VelocityTexture.Sample(PointSampler, uv).xy; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, uv).y; // 해당 셀의 깊이 + float2 vCenterVelocityUV = (g_VelocityTexture.Sample(PointSampler, uv).xy * 2.f - 1.f); float2 vCenterVelocityPixels = vCenterVelocityUV * g_vResolution.xy; // UV -> 픽셀 float fCenterSpreadLength = clamp(abs(vCenterVelocityPixels.y), 0.0f, g_fMBBlurRadius); float2 vSrcTexelSize = float2(1.f / g_vResolution.x, 1.f / g_vResolution.y); // 소스 셀 사이즈 g_vResolution-> 현재는 colortexture 해상도 @@ -339,15 +349,14 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) continue; } - fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y * g_fFar; - vSampledVelocityUV = g_VelocityTexture.Sample(PointSampler, vDestUV).xy; + fSampledDepth = g_DepthTexture.Sample(PointSampler, vDestUV).y; + vSampledVelocityUV = (g_VelocityTexture.Sample(PointSampler, vDestUV).xy * 2.f - 1.f); vSampledVelocityPixels = vSampledVelocityUV * g_vResolution.xy; fSampleSpreadLength = clamp(abs(vSampledVelocityPixels.y), 0.0f, g_fMBBlurRadius); // [Sample] float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, float(abs(i)), fCenterSpreadLength, fSampleSpreadLength, fPixelToSampleUnitsScale, fDepthScale); - if (fWeightCalculated <= 0.0f) - { + if (fWeightCalculated <= 0.0f) { continue; } vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vDestUV); @@ -362,9 +371,17 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLURY(PS_IN In) float fTapCount = (float) (2 * iMaxMotionBlurSampleCount + 1); float fCoverage = saturate(fWeight / max(fTapCount, 1.0f)); - Out.vColor = float4(vBlurColor.rgb, fCoverage); - //Out.vColor = vBlurColor; - Out.vVelocity = vBlurVelocity; + //Out.vColor = float4(vBlurColor.rgb, fCoverage); + Out.vColor = vBlurColor; + Out.vVelocity = vBlurVelocity * 0.5f + 0.5f; + float2 vBlurVelocityPixels = vBlurVelocity * g_vResolution.xy; + if (length(vBlurVelocityPixels) < 0.5f) // 0.5px 이하면 정지 취급 + { + Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, uv); + Out.vVelocity = float2(0.5f, 0.5f); + return Out; + } + return Out; } PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index a9cb198fc..ac62cdd81 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -873,6 +873,9 @@ void CRenderer::Render_PostProcessing() if (FAILED(m_pShader->Bind_RawValue("g_iMBSampleCount", &m_iMBSampleCount, sizeof(_int)))) { assert(false); return; } + if (FAILED(m_pShader->Bind_RawValue("g_iMBMaxSampleCount", &m_iMBMaxSampleCount, sizeof(_int)))) { + assert(false); return; + } if (FAILED(m_pShader->Bind_RawValue("g_iMBType", &m_iMBType, sizeof(_int)))) { assert(false); return; } diff --git a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp index 88e42dbed..5b4d8498d 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp @@ -674,8 +674,8 @@ void CRenderer::Describe_Entitiy() if (GUI::CollapsingHeader("MotionBlurr")) { GUI::Checkbox("m_bMB", &m_bMB); GUI::SliderFloat("g_fMBSampleBias", &m_fMBSampleBias, -1.f, 1.f, "%.3f"); - GUI::SliderFloat("g_fMBBlurRadius", &m_fMBBlurRadius, 0.1f, 16.f, "%.1f"); - GUI::SliderInt("g_iMBSampleCount", &m_iMBSampleCount, 0, 28, "%d"); + GUI::SliderFloat("g_fMBBlurRadius", &m_fMBBlurRadius, 0.1f, (_float)m_iMBMaxSampleCount, "%.1f"); + GUI::SliderInt("g_iMBSampleCount", &m_iMBSampleCount, 0, m_iMBMaxSampleCount, "%d"); } if (GUI::CollapsingHeader("End_Padding")) { } diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 5a34696e1..40e6f05f1 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -62,11 +62,12 @@ class CRenderer final : public CBase /* TunningParam */ // MotionBlur - _float m_fMBBlurRadius = { 8.f }; + _float m_fMBBlurRadius = { 28.f }; _float m_fMBSampleBias = { 0.005f }; - _int m_iMBSampleCount = { 14 }; + _int m_iMBMaxSampleCount = { 28 }; + _int m_iMBSampleCount = { m_iMBMaxSampleCount }; _int m_iMBType = { 0 }; - _bool m_bMB = { true }; + _bool m_bMB = { true }; // ToneMapping _int m_iToneMappingType = { 2 };