@pirireis/webglobeplugins 1.1.21 → 1.1.23

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.1.21",
3
+ "version": "1.1.23",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -84,7 +84,7 @@ void main() {
84
84
  break;
85
85
  }
86
86
  }
87
- vec3 position = a_position * (elevation + altitude * elevation_scale);
87
+ vec3 position = a_position * (elevation + altitude);
88
88
  gl_Position = cartesian3DToGLPosition(position);
89
89
  } else {
90
90
  vec2 mercatorXY = a_xy * POLE_BY_PI;
@@ -8,8 +8,6 @@ layout(std140) uniform DemTextureUniformBlock {
8
8
  vec4 u_textureDataCoverRatio[6]; // 96 bytes
9
9
  vec2 u_textureResolution; // 8 bytes
10
10
  int u_breakLoopIndex; // 4 bytes
11
- float elevation_scale;
12
-
13
11
  };
14
12
  uniform sampler2DArray u_demTexture;
15
13
  `;
@@ -19,9 +17,8 @@ const MAXLAYERS = 6;
19
17
  // CoverRatio: 6 * 16 bytes = 96
20
18
  // Resolution: 8 bytes (offset 192)
21
19
  // BreakLoopIndex: 4 bytes (offset 200)
22
- // Elevation scale: 4 bytes (offset 204)
23
- // Total used: 208 bytes.
24
- // std140 blocks no need for padding -> 208 bytes.
20
+ // Total used: 204 bytes.
21
+ // std140 blocks are typically padded to 16 bytes alignment -> 208 bytes.
25
22
  // 208 bytes / 4 bytes per float = 52 floats.
26
23
  const uniformBlockData = new Float32Array(52);
27
24
  function drawnedTilesHash(drawnTiles) {
@@ -165,7 +162,6 @@ export class DemTextureManager {
165
162
  uniformBlockData[49] = this.textureHeight;
166
163
  // Set break loop index (offset 200 bytes -> index 50)
167
164
  uniformBlockData[50] = this.mergedData.length;
168
- uniformBlockData[51] = this._globe.api_GetZScale();
169
165
  // Unbind texture after updating
170
166
  gl.bindTexture(gl.TEXTURE_2D_ARRAY, null);
171
167
  gl.bindBuffer(gl.UNIFORM_BUFFER, this.uniformBuffer);
@@ -211,9 +211,9 @@ The following is the glsl uniform block: ${CameraUniformBlockString}`;
211
211
  const gl = this.gl;
212
212
  const ubo = this.ubo;
213
213
  gl.deleteBuffer(ubo);
214
- if (this.attachments.size > 0) {
215
- throw new Error("There are still attachments registered to CameraUniformBlockTotem during free()");
216
- }
214
+ this.attachments.forEach((attachment) => {
215
+ attachment.free();
216
+ });
217
217
  }
218
218
  readBuffer() {
219
219
  const gl = this.gl;
@@ -5,7 +5,7 @@ export const CameraUniformBlockString = `
5
5
  layout(std140) uniform GpuSelectionUniformBlock {
6
6
  vec2 mouse_pixel_position;
7
7
  vec2 mouse_radian_long_lat;
8
- };
8
+ }; // 11 lines
9
9
  `;
10
10
  export default class CameraUniformBlockTotem {
11
11
  constructor() {