From 1c7c1a5c9703d64941e7a41dce6584a9626a8bf7 Mon Sep 17 00:00:00 2001 From: Wang Ruipeng <98011585+WANG-Ruipeng@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:23:21 -0500 Subject: [PATCH] Update bilateral_cleanup_pass.comp --- shaders/bilateral_cleanup_pass.comp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/shaders/bilateral_cleanup_pass.comp b/shaders/bilateral_cleanup_pass.comp index c56ef78..3e2002b 100644 --- a/shaders/bilateral_cleanup_pass.comp +++ b/shaders/bilateral_cleanup_pass.comp @@ -48,7 +48,7 @@ void main() vec3 result = vec3(0.0,0.0,0.0); float weightSum = 0.0; - if(length(centerColor) < 0.0001 || sqrt(variance) < 0.1){ + if(length(centerColor) < 0.0001 || sqrt(variance) < 2.0){ imageStore(bilateralCleanupColor, imageCoords, vec4(0.0)); return; } @@ -66,17 +66,14 @@ void main() if (neighborCoords.x < 0 || neighborCoords.y < 0 || neighborCoords.x >= imageRes.x || neighborCoords.y >= imageRes.y) continue; - //if(imageCoords.x == 0)debugPrintfEXT("result %f, %f, %f\n",result.x,result.y,result.z); vec4 neighborColor = imageLoad(filteredReflectionColor, neighborCoords); if(length (neighborColor.rgb) < 0.001) continue; - //if(imageCoords.x == 0)debugPrintfEXT("neighborColor %f, %f, %f\n",neighborColor.x,neighborColor.y,neighborColor.z); // Spatial weight float dist2 = float(x * x + y * y); float spatialWeight = exp(-dist2 / (2.0 * sigmaS * sigmaS)); // Range weight float colorDiff = length(neighborColor.rgb - centerColor.rgb); float rangeWeight = exp(-colorDiff * colorDiff / (2.0 * sigmaR * sigmaR)); - //if(imageCoords.x == 0)debugPrintfEXT("rangeWeight %f\n",rangeWeight); // Combined weight float weight = spatialWeight * rangeWeight; result += neighborColor.rgb * weight; @@ -86,12 +83,8 @@ void main() // Normalize result if (weightSum > 0.001) { result /= weightSum; - //debugPrintfEXT("%f/%f\n",result,weightSum); - //if(imageCoords.x == 0)debugPrintfEXT("result %f, %f, %f\n",result.x,result.y,result.z); } else { result = centerColor.rgb; } - //if(imageCoords.x == 0 && length(result) > 0.001)debugPrintfEXT("%f, %f, %f\n",result.x,result.y,result.z); - imageStore(bilateralCleanupColor, imageCoords, vec4(result, 1.0)); } \ No newline at end of file