From 054c00b8da74d68378c8e8e29cf37cce6df9c1a9 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 16 May 2020 15:04:57 -0700 Subject: Scattering FX: enabled control of the number of ray marching samples at depth breaks --- PostProcess/EpipolarLightScattering/src/EpipolarLightScattering.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'PostProcess/EpipolarLightScattering/src/EpipolarLightScattering.cpp') diff --git a/PostProcess/EpipolarLightScattering/src/EpipolarLightScattering.cpp b/PostProcess/EpipolarLightScattering/src/EpipolarLightScattering.cpp index 2e48000..4644fc2 100644 --- a/PostProcess/EpipolarLightScattering/src/EpipolarLightScattering.cpp +++ b/PostProcess/EpipolarLightScattering/src/EpipolarLightScattering.cpp @@ -2083,6 +2083,7 @@ void EpipolarLightScattering::PrepareForNewFrame(FrameAttribs& DEV_CHECK_ERR(PPAttribs.uiInstrIntegralSteps > 0, "Inscattering integral steps must not be 0"); DEV_CHECK_ERR(PPAttribs.f2ShadowMapTexelSize.x != 0 && PPAttribs.f2ShadowMapTexelSize.y != 0, "Shadow map texel size must not be 0"); DEV_CHECK_ERR(PPAttribs.uiMaxSamplesOnTheRay != 0, "Max samples on the ray must not be 0"); + DEV_CHECK_ERR(!PPAttribs.bCorrectScatteringAtDepthBreaks || PPAttribs.uiMaxSamplesOnTheRayAtDepthBreak != 0, "Max samples on the ray at depth correction pass must not be 0"); DEV_CHECK_ERR(PPAttribs.uiMinMaxShadowMapResolution != 0, "Minmax shadow map resolution must not be 0"); DEV_CHECK_ERR(PPAttribs.iNumCascades != 0, "Num cascades must not be 0"); DEV_CHECK_ERR(PPAttribs.iFirstCascadeToRayMarch < PPAttribs.iNumCascades, "First cascade to ray march (", PPAttribs.fFirstCascadeToRayMarch, ") is invalid"); @@ -2412,9 +2413,6 @@ void EpipolarLightScattering::PerformPostProcessing() // Interpolate ray marching samples onto the rest of samples InterpolateInsctrIrradiance(); - const Uint32 uiMaxStepsAlongRayAtDepthBreak0 = std::min(m_PostProcessingAttribs.uiMaxSamplesOnTheRay / 4, 256u); - //const Uint32 uiMaxStepsAlongRayAtDepthBreak1 = std::min(m_PostProcessingAttribs.uiMaxSamplesOnTheRay/8, 128u); - if (m_PostProcessingAttribs.ToneMapping.bAutoExposure) { // Render scene luminance to low-resolution texture @@ -2438,7 +2436,7 @@ void EpipolarLightScattering::PerformPostProcessing() // Correct inscattering for pixels, for which no suitable interpolation sources were found if (m_PostProcessingAttribs.bCorrectScatteringAtDepthBreaks) { - FixInscatteringAtDepthBreaks(uiMaxStepsAlongRayAtDepthBreak0, EFixInscatteringMode::FixInscattering); + FixInscatteringAtDepthBreaks(m_PostProcessingAttribs.uiMaxSamplesOnTheRayAtDepthBreak, EFixInscatteringMode::FixInscattering); } if (m_PostProcessingAttribs.bShowSampling) -- cgit v1.2.3