@pirireis/webglobeplugins 1.1.20 → 1.1.21

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.20",
3
+ "version": "1.1.21",
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);
87
+ vec3 position = a_position * (elevation + altitude * elevation_scale);
88
88
  gl_Position = cartesian3DToGLPosition(position);
89
89
  } else {
90
90
  vec2 mercatorXY = a_xy * POLE_BY_PI;
@@ -8,6 +8,8 @@ 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
+
11
13
  };
12
14
  uniform sampler2DArray u_demTexture;
13
15
  `;
@@ -17,8 +19,9 @@ const MAXLAYERS = 6;
17
19
  // CoverRatio: 6 * 16 bytes = 96
18
20
  // Resolution: 8 bytes (offset 192)
19
21
  // BreakLoopIndex: 4 bytes (offset 200)
20
- // Total used: 204 bytes.
21
- // std140 blocks are typically padded to 16 bytes alignment -> 208 bytes.
22
+ // Elevation scale: 4 bytes (offset 204)
23
+ // Total used: 208 bytes.
24
+ // std140 blocks no need for padding -> 208 bytes.
22
25
  // 208 bytes / 4 bytes per float = 52 floats.
23
26
  const uniformBlockData = new Float32Array(52);
24
27
  function drawnedTilesHash(drawnTiles) {
@@ -162,6 +165,7 @@ export class DemTextureManager {
162
165
  uniformBlockData[49] = this.textureHeight;
163
166
  // Set break loop index (offset 200 bytes -> index 50)
164
167
  uniformBlockData[50] = this.mergedData.length;
168
+ uniformBlockData[51] = this._globe.api_GetZScale();
165
169
  // Unbind texture after updating
166
170
  gl.bindTexture(gl.TEXTURE_2D_ARRAY, null);
167
171
  gl.bindBuffer(gl.UNIFORM_BUFFER, this.uniformBuffer);
@@ -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
- }; // 11 lines
8
+ };
9
9
  `;
10
10
  export default class CameraUniformBlockTotem {
11
11
  constructor() {