diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_3_24_25__12_40PM__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_3_24_25__12_40PM__Changes_.xml
index 888d6bd..30797ce 100644
--- a/.idea/shelf/Uncommitted_changes_before_Update_at_3_24_25__12_40PM__Changes_.xml
+++ b/.idea/shelf/Uncommitted_changes_before_Update_at_3_24_25__12_40PM__Changes_.xml
@@ -3,5 +3,7 @@
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ebc73ff..50ffb7e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -8,7 +8,9 @@
+
+
@@ -17,7 +19,7 @@
-
+
diff --git a/client/src/lib/Map.svelte b/client/src/lib/Map.svelte
index 845e5a9..c4d7d45 100644
--- a/client/src/lib/Map.svelte
+++ b/client/src/lib/Map.svelte
@@ -249,6 +249,7 @@
gl.getUniformLocation(this.program, 'startRange'),
drd.radials[0].product?.data?.startRange
);
+ console.log(drd.radials[0].product?.data?.startRange);
gl.uniform1f(
gl.getUniformLocation(this.program, 'sampleInterval'),
drd.radials[0].product?.data?.sampleInterval
diff --git a/client/src/lib/map/fragment.glsl b/client/src/lib/map/fragment.glsl
index 8b415fa..4f3ef87 100644
--- a/client/src/lib/map/fragment.glsl
+++ b/client/src/lib/map/fragment.glsl
@@ -78,15 +78,33 @@ void main() {
float deltaLambda = radians(lng - radarLng);
float d_m = acos(sin(phi1) * sin(phi2) + cos(phi1) * cos(phi2) * cos(deltaLambda)) * R;
- //fragColor = vec4(d_m / 459296.0, 0.0, 0.0, 1.0);
- //return;
+ float distance_km = d_m / 1000.0;
+ float first_gate_distance_km = startRange / 1000.0;
+ float gate_spacing_km = sampleInterval / 1000.0;
+ int gate = int(round((distance_km - first_gate_distance_km) / gate_spacing_km));
float y = sin(lambda2 - lambda1) * cos(phi2);
float x = cos(phi1) * sin(phi2) - sin(phi1) * cos(phi2) * cos(lambda2 - lambda1);
float theta = atan(y, x);
float azimuth = mod((theta * 180.0 / PI + 360.0), 360.0);
- fragColor = vec4(azimuth / 360.0, 0.0, 0.0, 1.0);
+ if (distance_km < 10.0) {
+ fragColor = vec4(0.0,1.0,0.0,1.0);
+ return;
+ }
+
+ if (distance_km < first_gate_distance_km || gate < 0) {
+ fragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ return;
+ }
+
+ if (gate > 1832) {
+ fragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ return;
+ }
+
+ fragColor = vec4(float(gate) / 1832.0, 0.0, 0.0, 1.0);
+ //fragColor = vec4(float(gate) / 1832.0, 0.0, azimuth / 360.0, 1.0);
return;
LocateRadialResult maybeRadial = locateRadial(azimuth);
@@ -95,25 +113,7 @@ void main() {
return;
}
- float distance_km = d_m / 1000.0;
- float first_gate_distance_km = startRange / 1000.0;
- float gate_spacing_km = sampleInterval / 1000.0;
- if (distance_km < first_gate_distance_km) {
- fragColor = vec4(0.0, 0.0, 0.0, 0.0);
- return;
- }
-
- int gate = int(round((distance_km - first_gate_distance_km) / gate_spacing_km));
- if (gate > 1832) {
- fragColor = vec4(0.0, 0.0, 0.0, 0.0);
- return;
- }
-
- if (!maybeRadial.didFindRadial) {
- fragColor = vec4(0.0, 0.0, 0.0, 0.0);
- return;
- }
ivec2 coords = ivec2(maybeRadial.radialIndex, gate);
float rawValue = texelFetch(scaledData, coords, 0).r;