Browse Source

Fix a few things

Panagiotis Christopoulos Charitos 5 years ago
parent
commit
827232be1e
2 changed files with 2 additions and 2 deletions
  1. 1 1
      shaders/SsgiDenoise.ankiprog
  2. 1 1
      shaders/SsgiReconstruct.ankiprog

+ 1 - 1
shaders/SsgiDenoise.ankiprog

@@ -28,7 +28,7 @@ layout(set = 0, binding = 3) writeonly uniform image2D u_outImg;
 F32 computeDepthWeight(F32 refDepth, F32 depth)
 F32 computeDepthWeight(F32 refDepth, F32 depth)
 {
 {
 	const F32 diff = abs(refDepth - depth);
 	const F32 diff = abs(refDepth - depth);
-	const F32 weight = 1.0 - pow(diff, 0.5);
+	const F32 weight = sqrt(1.0 / (EPSILON + diff));
 	return weight;
 	return weight;
 }
 }
 
 

+ 1 - 1
shaders/SsgiReconstruct.ankiprog

@@ -31,7 +31,7 @@ shared Vec4 s_depths[WORKGROUP_SIZE.y][WORKGROUP_SIZE.x];
 F32 computeDepthWeights(F32 refDepth, F32 depth)
 F32 computeDepthWeights(F32 refDepth, F32 depth)
 {
 {
 	const F32 diff = abs(refDepth - depth);
 	const F32 diff = abs(refDepth - depth);
-	const F32 weight = 1.0 - pow(diff, 0.5);
+	const F32 weight = sqrt(1.0 / (EPSILON + diff));
 	return weight;
 	return weight;
 }
 }