Commit: 467ea7ec5c0f1fcc2df186537356c276e1298f16
Parent: a5e943af86cc8aead5ed2b599ae837b7e67e0b34
Author: Randy Palamar
Date: Thu, 11 Jul 2024 16:14:41 -0600
shaders: properly map channels when decoding/beamforming
Diffstat:
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/shaders/hadamard.glsl b/shaders/hadamard.glsl
@@ -48,11 +48,9 @@ void main()
uint out_stride = rf_data_dim.x * rf_data_dim.y;
uint out_off = rf_data_dim.x * channel + time_sample;
- /* TODO: channel_mapping */
- //uint ch_base_idx = (channel + channel_offset) / 4;
- //uint ch_sub_idx = (channel + channel_offset) - ch_base_idx;
- //uint rf_channel = channel_mapping[ch_base_idx][ch_sub_idx];
- uint rf_channel = channel;
+ uint ch_base_idx = (channel + channel_offset) / 4;
+ uint ch_sub_idx = (channel + channel_offset) - ch_base_idx * 4;
+ uint rf_channel = channel_mapping[ch_base_idx][ch_sub_idx];
/* NOTE: offsets to get the time sample and row in rf data */
uint rf_stride = channel_data_stride * rf_data_dim.y;
diff --git a/shaders/uforces.glsl b/shaders/uforces.glsl
@@ -77,7 +77,7 @@ void main()
/* NOTE: skip first acquisition since its garbage */
for (uint i = 1; i < rf_data_dim.z; i++) {
uint base_idx = (i - 1) / 4;
- uint sub_idx = (i - 1) - base_idx;
+ uint sub_idx = (i - 1) - base_idx * 4;
vec3 focal_point = vec3(uforces_channels[base_idx][sub_idx] * dx, 0, focal_depth);
float transmit_dist = focal_depth + dzsign * distance(image_point, focal_point);