Commit: a8803f7326a1c8b9504164932b1be2b8abc9e40b
Parent: 005a95449bc29b51acc2060d53f71747319aa162
Author: Randy Palamar
Date: Mon, 28 Oct 2024 12:52:46 -0600
uforces/hercules: branchlessly discard invalid time samples
now we don't display anything for depths beyond what was actually acquired
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/shaders/hercules.glsl b/shaders/hercules.glsl
@@ -145,7 +145,9 @@ void main()
float a = cos(clamp(abs(apod_arg * rdist.x), 0, 0.25 * radians(360)));
a = a * a;
- vec2 p = cubic(ridx, time * sampling_frequency);
+ float sidx = time * sampling_frequency;
+ vec2 valid = vec2(sidx < dec_data_dim.x);
+ vec2 p = cubic(ridx, sidx);
/* NOTE: tribal knowledge; this is a problem with the imaging sequence */
if (i == 0) p *= inversesqrt(128);
sum += p;
diff --git a/shaders/uforces.glsl b/shaders/uforces.glsl
@@ -131,10 +131,12 @@ void main()
float a = cos(clamp(abs(apod_arg * rdist.x), 0, 0.25 * radians(360)));
a = a * a;
- vec2 p = cubic(ridx, time * sampling_frequency);
- sum += p * a;
- rdist -= delta;
- ridx += dec_data_dim.x;
+ float sidx = time * sampling_frequency;
+ vec2 valid = vec2(sidx < dec_data_dim.x);
+ vec2 p = cubic(ridx, sidx) * valid;
+ sum += p * a;
+ rdist -= delta;
+ ridx += dec_data_dim.x;
}
}
imageStore(u_out_data_tex, out_coord, vec4(sum.x, sum.y, 0, 0));