@pirireis/webglobeplugins 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -56,6 +56,7 @@ ${relativeBBoxPositionRadian}
56
56
  void main() {
57
57
  float elevation = ${WORLD_RADIUS_3D};
58
58
  float altitude = 20000.0;
59
+ bool hasDemSample = false;
59
60
 
60
61
  // Always define v_index to avoid undefined varyings when picking is disabled.
61
62
 
@@ -69,6 +70,9 @@ void main() {
69
70
  // a_color.a == 255u is reserved as "no per-vertex color" sentinel.
70
71
  v_color = (a_color.a == 255u || useDefaultColor == true) ? defaultColor : decodedColor;
71
72
 
73
+ // Always define v_index to avoid undefined varyings when picking is disabled.
74
+ v_index = a_index;
75
+
72
76
  if (is3D == true) {
73
77
  for (int i = 0; i < 6; i++) {
74
78
  if( i == u_breakLoopIndex - 1 ) {
@@ -82,9 +86,16 @@ void main() {
82
86
 
83
87
  //
84
88
  altitude = texture(u_demTexture, vec3(uv, float(i))).r;
89
+ hasDemSample = true;
85
90
  break;
86
91
  }
87
92
  }
93
+
94
+ // If the geometry is outside all given bboxes, force NaN so the primitive gets discarded.
95
+ if (!hasDemSample) {
96
+ altitude = 0.0 / 0.0;
97
+ }
98
+
88
99
  vec3 position = a_position * (elevation + altitude * elevation_scale);
89
100
  gl_Position = cartesian3DToGLPosition(position);
90
101
  } else {
@@ -96,7 +107,6 @@ void main() {
96
107
  if (a_index == private_pickedIndex && private_changeHoverColor == true ) {
97
108
  v_color = hoverColor;
98
109
  }
99
- v_index = a_index;
100
110
  }
101
111
 
102
112