From 7894b401117dce5e1f0c112e6b3faa39817c5487 Mon Sep 17 00:00:00 2001 From: Sam Belliveau Date: Tue, 14 Nov 2023 12:05:12 -0500 Subject: [PATCH] Fix inner area sampling loop from going beyond bounds --- Data/Sys/Shaders/default_pre_post_process.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Data/Sys/Shaders/default_pre_post_process.glsl b/Data/Sys/Shaders/default_pre_post_process.glsl index 3481f65a03..f6854d11fd 100644 --- a/Data/Sys/Shaders/default_pre_post_process.glsl +++ b/Data/Sys/Shaders/default_pre_post_process.glsl @@ -239,8 +239,8 @@ float4 AreaSampling(float3 uvw, float gamma) avg_color += area_se * QuickSampleByPixel(float2(f_end.x, f_end.y) + offset, uvw.z, gamma); // Determine the size of the pixel box. - int x_range = int(f_end.x - f_beg.x + 0.5); - int y_range = int(f_end.y - f_beg.y + 0.5); + int x_range = int(f_end.x - f_beg.x - 0.5); + int y_range = int(f_end.y - f_beg.y - 0.5); // Workaround to compile the shader with DX11/12. // If this isn't done, it will complain that the loop could have too many iterations. @@ -405,4 +405,4 @@ void main() } SetOutput(color); -} \ No newline at end of file +}