Commit: d606181dcbd5ce863064b3a9fcd2e3873df9f44b
Parent: 61237b2d1cae4f5602f26be6be5483da79c88f0d
Author: Randy Palamar
Date: Sun, 8 Sep 2024 21:01:15 -0600
use swizzling for calculating image point in HERCULES/UFORCES shaders
Diffstat:
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/shaders/hercules.glsl b/shaders/hercules.glsl
@@ -79,11 +79,7 @@ void main()
/* NOTE: Convert pixel to physical coordinates */
vec2 xdc_size = abs(xdc_max_xy - xdc_min_xy);
vec4 output_size = abs(output_max_coord - output_min_coord);
- vec3 image_point = vec3(
- output_min_coord.x + voxel.x * output_size.x / out_data_dim.x,
- output_min_coord.y + voxel.y * output_size.y / out_data_dim.y,
- output_min_coord.z + voxel.z * output_size.z / out_data_dim.z
- );
+ vec3 image_point = output_min_coord.xyz + voxel * output_size.xyz / out_data_dim.xyz;
/* TODO: off_axis_position */
if (u_volume_export_pass == 0)
diff --git a/shaders/uforces.glsl b/shaders/uforces.glsl
@@ -76,11 +76,7 @@ void main()
/* NOTE: Convert voxel to physical coordinates */
vec2 xdc_size = abs(xdc_max_xy - xdc_min_xy);
vec4 output_size = abs(output_max_coord - output_min_coord);
- vec3 image_point = vec3(
- output_min_coord.x + voxel.x * output_size.x / out_data_dim.x,
- output_min_coord.y + voxel.y * output_size.y / out_data_dim.y,
- output_min_coord.z + voxel.z * output_size.z / out_data_dim.z
- );
+ vec3 image_point = output_min_coord.xyz + voxel * output_size.xyz / out_data_dim.xyz;
/* NOTE: used for constant F# dynamic receive apodization. This is implemented as:
*