@openglobus/og 0.11.8 → 0.12.4

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.
Files changed (197) hide show
  1. package/css/og.css +2 -0
  2. package/dist/@openglobus/og.css +1 -0
  3. package/dist/@openglobus/og.esm.js +21 -0
  4. package/dist/@openglobus/og.esm.js.map +1 -0
  5. package/dist/@openglobus/og.umd.js +21 -0
  6. package/dist/@openglobus/og.umd.js.map +1 -0
  7. package/package.json +11 -11
  8. package/src/og/Globe.js +18 -6
  9. package/src/og/camera/Camera.js +70 -79
  10. package/src/og/camera/PlanetCamera.js +25 -30
  11. package/src/og/control/DebugInfo.js +2 -2
  12. package/src/og/control/EarthNavigation.js +26 -17
  13. package/src/og/control/MouseNavigation.js +11 -13
  14. package/src/og/control/MouseWheelZoomControl.js +5 -5
  15. package/src/og/control/Sun.js +3 -3
  16. package/src/og/entity/Entity.js +742 -742
  17. package/src/og/entity/GeoObjectHandler.js +138 -134
  18. package/src/og/entity/LabelHandler.js +2 -1
  19. package/src/og/layer/CanvasTiles.js +8 -11
  20. package/src/og/layer/KML.js +19 -12
  21. package/src/og/layer/Layer.js +9 -2
  22. package/src/og/layer/XYZ.js +27 -28
  23. package/src/og/math/Vec3.js +18 -2
  24. package/src/og/quadTree/Node.js +48 -93
  25. package/src/og/quadTree/quadTree.js +1 -1
  26. package/src/og/renderer/Renderer.js +3 -5
  27. package/src/og/scene/Planet.js +147 -127
  28. package/src/og/segment/Segment.js +63 -136
  29. package/src/og/shaders/drawnode.js +132 -221
  30. package/src/og/shaders/geoObject.js +15 -6
  31. package/src/og/terrain/EmptyTerrain.js +3 -2
  32. package/src/og/terrain/GlobusTerrain.js +2 -0
  33. package/src/og/utils/Loader.js +1 -1
  34. package/src/og/utils/PlainSegmentWorker.js +0 -13
  35. package/src/og/webgl/Handler.js +13 -9
  36. package/types/Clock.d.ts +94 -0
  37. package/types/Deferred.d.ts +6 -0
  38. package/types/Events.d.ts +77 -0
  39. package/types/Extent.d.ts +166 -0
  40. package/types/Globe.d.ts +85 -0
  41. package/types/ImageCanvas.d.ts +123 -0
  42. package/types/Lock.d.ts +12 -0
  43. package/types/LonLat.d.ts +108 -0
  44. package/types/Popup.d.ts +42 -0
  45. package/types/QueueArray.d.ts +19 -0
  46. package/types/Rectangle.d.ts +80 -0
  47. package/types/Stack.d.ts +19 -0
  48. package/types/ajax.d.ts +24 -0
  49. package/types/arial.d.ts +48 -0
  50. package/types/astro/astro.d.ts +38 -0
  51. package/types/astro/earth.d.ts +7 -0
  52. package/types/astro/jd.d.ts +254 -0
  53. package/types/bv/Box.d.ts +30 -0
  54. package/types/bv/Sphere.d.ts +38 -0
  55. package/types/bv/index.d.ts +3 -0
  56. package/types/camera/Camera.d.ts +312 -0
  57. package/types/camera/Frustum.d.ts +133 -0
  58. package/types/camera/PlanetCamera.d.ts +219 -0
  59. package/types/camera/index.d.ts +3 -0
  60. package/types/cons.d.ts +40 -0
  61. package/types/control/CompassButton.d.ts +17 -0
  62. package/types/control/Control.d.ts +104 -0
  63. package/types/control/DebugInfo.d.ts +15 -0
  64. package/types/control/EarthCoordinates.d.ts +47 -0
  65. package/types/control/EarthNavigation.d.ts +43 -0
  66. package/types/control/GeoImageDragControl.d.ts +6 -0
  67. package/types/control/KeyboardNavigation.d.ts +21 -0
  68. package/types/control/LayerSwitcher.d.ts +21 -0
  69. package/types/control/Lighting.d.ts +16 -0
  70. package/types/control/MouseNavigation.d.ts +48 -0
  71. package/types/control/MouseWheelZoomControl.d.ts +45 -0
  72. package/types/control/ScaleControl.d.ts +22 -0
  73. package/types/control/ShowFps.d.ts +11 -0
  74. package/types/control/SimpleNavigation.d.ts +25 -0
  75. package/types/control/Sun.d.ts +50 -0
  76. package/types/control/ToggleWireframe.d.ts +12 -0
  77. package/types/control/TouchNavigation.d.ts +48 -0
  78. package/types/control/ZoomControl.d.ts +27 -0
  79. package/types/control/index.d.ts +18 -0
  80. package/types/ellipsoid/Ellipsoid.d.ts +146 -0
  81. package/types/ellipsoid/index.d.ts +3 -0
  82. package/types/ellipsoid/wgs84.d.ts +6 -0
  83. package/types/entity/BaseBillboard.d.ts +215 -0
  84. package/types/entity/Billboard.d.ts +94 -0
  85. package/types/entity/BillboardHandler.d.ts +79 -0
  86. package/types/entity/Entity.d.ts +348 -0
  87. package/types/entity/EntityCollection.d.ts +317 -0
  88. package/types/entity/GeoObject.d.ts +111 -0
  89. package/types/entity/GeoObjectHandler.d.ts +81 -0
  90. package/types/entity/Geometry.d.ts +74 -0
  91. package/types/entity/GeometryHandler.d.ts +76 -0
  92. package/types/entity/Label.d.ts +189 -0
  93. package/types/entity/LabelHandler.d.ts +31 -0
  94. package/types/entity/LabelWorker.d.ts +11 -0
  95. package/types/entity/PointCloud.d.ts +174 -0
  96. package/types/entity/PointCloudHandler.d.ts +38 -0
  97. package/types/entity/Polyline.d.ts +306 -0
  98. package/types/entity/PolylineHandler.d.ts +18 -0
  99. package/types/entity/Ray.d.ts +124 -0
  100. package/types/entity/RayHandler.d.ts +67 -0
  101. package/types/entity/ShapeHandler.d.ts +22 -0
  102. package/types/entity/Strip.d.ts +119 -0
  103. package/types/entity/StripHandler.d.ts +38 -0
  104. package/types/entity/index.d.ts +8 -0
  105. package/types/index.core.d.ts +65 -0
  106. package/types/index.d.ts +45 -0
  107. package/types/index.webgl.d.ts +7 -0
  108. package/types/input/KeyboardHandler.d.ts +10 -0
  109. package/types/input/MouseHandler.d.ts +5 -0
  110. package/types/input/TouchHandler.d.ts +5 -0
  111. package/types/input/input.d.ts +34 -0
  112. package/types/layer/BaseGeoImage.d.ts +94 -0
  113. package/types/layer/CanvasTiles.d.ts +67 -0
  114. package/types/layer/GeoImage.d.ts +52 -0
  115. package/types/layer/GeoTexture2d.d.ts +8 -0
  116. package/types/layer/GeoVideo.d.ts +55 -0
  117. package/types/layer/KML.d.ts +68 -0
  118. package/types/layer/Layer.d.ts +311 -0
  119. package/types/layer/Material.d.ts +45 -0
  120. package/types/layer/Vector.d.ts +208 -0
  121. package/types/layer/WMS.d.ts +61 -0
  122. package/types/layer/XYZ.d.ts +119 -0
  123. package/types/layer/index.d.ts +10 -0
  124. package/types/light/LightSource.d.ts +178 -0
  125. package/types/math/Line2.d.ts +11 -0
  126. package/types/math/Line3.d.ts +10 -0
  127. package/types/math/Mat3.d.ts +65 -0
  128. package/types/math/Mat4.d.ts +176 -0
  129. package/types/math/Plane.d.ts +18 -0
  130. package/types/math/Quat.d.ts +379 -0
  131. package/types/math/Ray.d.ts +82 -0
  132. package/types/math/Vec2.d.ts +309 -0
  133. package/types/math/Vec3.d.ts +467 -0
  134. package/types/math/Vec4.d.ts +162 -0
  135. package/types/math/coder.d.ts +43 -0
  136. package/types/math/index.d.ts +11 -0
  137. package/types/math.d.ts +261 -0
  138. package/types/mercator.d.ts +92 -0
  139. package/types/proj/EPSG3857.d.ts +6 -0
  140. package/types/proj/EPSG4326.d.ts +6 -0
  141. package/types/proj/Proj.d.ts +42 -0
  142. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  143. package/types/quadTree/Node.d.ts +60 -0
  144. package/types/quadTree/quadTree.d.ts +40 -0
  145. package/types/renderer/Renderer.d.ts +290 -0
  146. package/types/renderer/RendererEvents.d.ts +237 -0
  147. package/types/res/images.d.ts +3 -0
  148. package/types/scene/Axes.d.ts +11 -0
  149. package/types/scene/BaseNode.d.ts +60 -0
  150. package/types/scene/Planet.d.ts +576 -0
  151. package/types/scene/RenderNode.d.ts +142 -0
  152. package/types/scene/SkyBox.d.ts +10 -0
  153. package/types/scene/index.d.ts +4 -0
  154. package/types/segment/Segment.d.ts +275 -0
  155. package/types/segment/SegmentLonLat.d.ts +17 -0
  156. package/types/segment/Slice.d.ts +10 -0
  157. package/types/segment/segmentHelper.d.ts +13 -0
  158. package/types/shaders/billboard.d.ts +3 -0
  159. package/types/shaders/depth.d.ts +2 -0
  160. package/types/shaders/drawnode.d.ts +7 -0
  161. package/types/shaders/geoObject.d.ts +3 -0
  162. package/types/shaders/label.d.ts +4 -0
  163. package/types/shaders/pointCloud.d.ts +2 -0
  164. package/types/shaders/polyline.d.ts +3 -0
  165. package/types/shaders/ray.d.ts +2 -0
  166. package/types/shaders/screenFrame.d.ts +2 -0
  167. package/types/shaders/shape.d.ts +4 -0
  168. package/types/shaders/skybox.d.ts +2 -0
  169. package/types/shaders/toneMapping.d.ts +2 -0
  170. package/types/shapes/BaseShape.d.ts +250 -0
  171. package/types/shapes/Sphere.d.ts +41 -0
  172. package/types/terrain/BilTerrain.d.ts +7 -0
  173. package/types/terrain/EmptyTerrain.d.ts +73 -0
  174. package/types/terrain/Geoid.d.ts +26 -0
  175. package/types/terrain/GlobusTerrain.d.ts +116 -0
  176. package/types/terrain/MapboxTerrain.d.ts +7 -0
  177. package/types/terrain/index.d.ts +5 -0
  178. package/types/utils/FontAtlas.d.ts +15 -0
  179. package/types/utils/GeoImageCreator.d.ts +30 -0
  180. package/types/utils/ImagesCacheManager.d.ts +10 -0
  181. package/types/utils/Loader.d.ts +25 -0
  182. package/types/utils/NormalMapCreator.d.ts +39 -0
  183. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  184. package/types/utils/TerrainWorker.d.ts +9 -0
  185. package/types/utils/TextureAtlas.d.ts +111 -0
  186. package/types/utils/VectorTileCreator.d.ts +16 -0
  187. package/types/utils/colorTable.d.ts +143 -0
  188. package/types/utils/earcut.d.ts +6 -0
  189. package/types/utils/shared.d.ts +231 -0
  190. package/types/webgl/Framebuffer.d.ts +135 -0
  191. package/types/webgl/Handler.d.ts +417 -0
  192. package/types/webgl/Multisample.d.ts +89 -0
  193. package/types/webgl/Program.d.ts +161 -0
  194. package/types/webgl/ProgramController.d.ts +89 -0
  195. package/types/webgl/callbacks.d.ts +1 -0
  196. package/types/webgl/index.d.ts +6 -0
  197. package/types/webgl/types.d.ts +2 -0
@@ -14,8 +14,6 @@ import * as segmentHelper from "../segment/segmentHelper.js";
14
14
  import { getMatrixSubArray } from "../utils/shared.js";
15
15
  import { Slice } from "./Slice.js";
16
16
 
17
- export const MAX_NORMAL_ZOOM = 7;
18
-
19
17
  var _tempHigh = new Vec3();
20
18
  var _tempLow = new Vec3();
21
19
 
@@ -41,8 +39,6 @@ _V[E] = true;
41
39
  _V[S] = false;
42
40
  _V[W] = true;
43
41
 
44
- window.BBSC = 100;
45
-
46
42
  /**
47
43
  * Planet segment Web Mercator tile class that stored and rendered with quad tree.
48
44
  * @class
@@ -97,10 +93,17 @@ class Segment {
97
93
  */
98
94
  this.bbox = new Box();
99
95
 
100
- this._swNorm = null;
101
- this._nwNorm = null;
102
- this._seNorm = null;
103
- this._neNorm = null;
96
+ //this._swNorm = null;
97
+ //this._nwNorm = null;
98
+ //this._seNorm = null;
99
+ //this._neNorm = null;
100
+
101
+ this._sw = new Vec3();
102
+ this._nw = new Vec3();
103
+ this._se = new Vec3();
104
+ this._ne = new Vec3();
105
+
106
+ this.centerNormal = new Vec3();
104
107
 
105
108
  /**
106
109
  * Geographical extent.
@@ -196,6 +199,12 @@ class Segment {
196
199
  */
197
200
  this.terrainExists = false;
198
201
 
202
+ /**
203
+ * Means that tree passage reach the segment, and the segment terrain is ready.
204
+ * @type {boolean}
205
+ */
206
+ this.passReady = false;
207
+
199
208
  this.plainVertices = null;
200
209
  this.plainVerticesHigh = null;
201
210
  this.plainVerticesLow = null;
@@ -237,19 +246,6 @@ class Segment {
237
246
  this.plainProcessing = false;
238
247
  }
239
248
 
240
- /**
241
- * Returns that segment good for rendering with camera by current lod ratio.
242
- * @public
243
- * @param {Camera} camera - Camera object.
244
- * @returns {boolean} -
245
- */
246
- acceptForRendering(camera) {
247
- return (
248
- camera.projectedSize(this.bsphere.center, this._plainRadius) <
249
- 256 / this.planet._lodRatio
250
- );
251
- }
252
-
253
249
  /**
254
250
  * Returns entity terrain point.
255
251
  * @public
@@ -997,22 +993,19 @@ class Segment {
997
993
  var coord_sw = ellipsoid.geodeticToCartesian(extent.southWest.lon, extent.southWest.lat);
998
994
  var coord_ne = ellipsoid.geodeticToCartesian(extent.northEast.lon, extent.northEast.lat);
999
995
 
1000
- // check for zoom
1001
- if (this.tileZoom <= MAX_NORMAL_ZOOM) {
1002
- var coord_nw = ellipsoid.geodeticToCartesian(
1003
- extent.southWest.lon,
1004
- extent.northEast.lat
1005
- );
1006
- var coord_se = ellipsoid.geodeticToCartesian(
1007
- extent.northEast.lon,
1008
- extent.southWest.lat
1009
- );
996
+ var coord_nw = ellipsoid.geodeticToCartesian(
997
+ extent.southWest.lon,
998
+ extent.northEast.lat
999
+ );
1000
+ var coord_se = ellipsoid.geodeticToCartesian(
1001
+ extent.northEast.lon,
1002
+ extent.southWest.lat
1003
+ );
1010
1004
 
1011
- this._swNorm = coord_sw.normal();
1012
- this._nwNorm = coord_nw.normal();
1013
- this._neNorm = coord_ne.normal();
1014
- this._seNorm = coord_se.normal();
1015
- }
1005
+ this._sw.copy(coord_sw);
1006
+ this._nw.copy(coord_nw);
1007
+ this._ne.copy(coord_ne);
1008
+ this._se.copy(coord_se);
1016
1009
 
1017
1010
  this.setBoundingVolume3v(coord_sw, coord_ne);
1018
1011
  }
@@ -1041,31 +1034,30 @@ class Segment {
1041
1034
  this.bsphere.center.z = pn.segment.bsphere.center.z;
1042
1035
  this.bsphere.radius = pn.segment.bsphere.radius;
1043
1036
 
1044
- if (this.tileZoom <= MAX_NORMAL_ZOOM) {
1045
- let i0 = gridSize * offsetY;
1046
- let j0 = gridSize * offsetX;
1037
+ let i0 = gridSize * offsetY;
1038
+ let j0 = gridSize * offsetX;
1047
1039
 
1048
- let pnGsOne = pn.segment.gridSize + 1;
1040
+ let pnGsOne = pn.segment.gridSize + 1;
1049
1041
 
1050
- let ind_sw = 3 * ((i0 + gridSize) * pnGsOne + j0),
1051
- ind_nw = 3 * (i0 * pnGsOne + j0),
1052
- ind_ne = 3 * (i0 * pnGsOne + j0 + gridSize),
1053
- ind_se = 3 * ((i0 + gridSize) * pnGsOne + j0 + gridSize);
1042
+ let ind_sw = 3 * ((i0 + gridSize) * pnGsOne + j0),
1043
+ ind_nw = 3 * (i0 * pnGsOne + j0),
1044
+ ind_ne = 3 * (i0 * pnGsOne + j0 + gridSize),
1045
+ ind_se = 3 * ((i0 + gridSize) * pnGsOne + j0 + gridSize);
1054
1046
 
1055
- let pVerts = pn.segment.tempVertices;
1047
+ let pVerts = pn.segment.tempVertices;
1056
1048
 
1057
- let v_sw = new Vec3(pVerts[ind_sw], pVerts[ind_sw + 1], pVerts[ind_sw + 2]),
1058
- v_ne = new Vec3(pVerts[ind_ne], pVerts[ind_ne + 1], pVerts[ind_ne + 2]);
1049
+ let v_sw = new Vec3(pVerts[ind_sw], pVerts[ind_sw + 1], pVerts[ind_sw + 2]),
1050
+ v_ne = new Vec3(pVerts[ind_ne], pVerts[ind_ne + 1], pVerts[ind_ne + 2]);
1059
1051
 
1060
- // check for segment zoom
1061
- let v_nw = new Vec3(pVerts[ind_nw], pVerts[ind_nw + 1], pVerts[ind_nw + 2]),
1062
- v_se = new Vec3(pVerts[ind_se], pVerts[ind_se + 1], pVerts[ind_se + 2]);
1052
+ // check for segment zoom
1053
+ let v_nw = new Vec3(pVerts[ind_nw], pVerts[ind_nw + 1], pVerts[ind_nw + 2]),
1054
+ v_se = new Vec3(pVerts[ind_se], pVerts[ind_se + 1], pVerts[ind_se + 2]);
1055
+
1056
+ this._sw.copy(v_sw);
1057
+ this._nw.copy(v_nw);
1058
+ this._ne.copy(v_ne);
1059
+ this._se.copy(v_se);
1063
1060
 
1064
- this._swNorm = v_sw.normal();
1065
- this._nwNorm = v_nw.normal();
1066
- this._neNorm = v_ne.normal();
1067
- this._seNorm = v_se.normal();
1068
- }
1069
1061
  } else {
1070
1062
  let pseg = pn.segment;
1071
1063
 
@@ -1545,7 +1537,7 @@ class Segment {
1545
1537
  }
1546
1538
  }
1547
1539
 
1548
- heightPickingRendering(sh, layerSlice, sliceIndex, defaultTexture, isOverlay) {
1540
+ heightPickingRendering(sh, layerSlice) {
1549
1541
  var gl = this.handler.gl;
1550
1542
  var sha = sh.attributes,
1551
1543
  shu = sh.uniforms;
@@ -1553,11 +1545,6 @@ class Segment {
1553
1545
  var pm = this.materials,
1554
1546
  p = this.planet;
1555
1547
 
1556
- // First always draw whole planet base layer segment with solid texture.
1557
- gl.activeTexture(gl.TEXTURE0 + p.SLICE_SIZE);
1558
- gl.bindTexture(gl.TEXTURE_2D, defaultTexture || p.solidTextureOne);
1559
- gl.uniform1i(shu.defaultTexture, p.SLICE_SIZE);
1560
-
1561
1548
  var currHeight;
1562
1549
  if (layerSlice) {
1563
1550
  currHeight = layerSlice[0]._height;
@@ -1565,42 +1552,16 @@ class Segment {
1565
1552
  currHeight = 0;
1566
1553
  }
1567
1554
 
1568
- var slice = this._slices[sliceIndex];
1569
-
1570
- var notEmpty = false;
1555
+ gl.uniform1f(shu.height, currHeight);
1571
1556
 
1572
- let len = slice.layers.length;
1573
-
1574
- for (let n = 0; n < len; n++) {
1575
- notEmpty = true;
1576
- p._samplerArr[n] = n;
1577
- gl.activeTexture(gl.TEXTURE0 + n);
1578
- gl.bindTexture(gl.TEXTURE_2D, pm[slice.layers[n]._id].texture || p.transparentTexture);
1579
- }
1557
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferHigh);
1558
+ gl.vertexAttribPointer(sha.aVertexPositionHigh, this.vertexPositionBufferHigh.itemSize, gl.FLOAT, false, 0, 0);
1580
1559
 
1581
- if (notEmpty || !isOverlay) {
1582
- gl.uniform1i(shu.samplerCount, len);
1583
- gl.uniform1f(shu.height, currHeight);
1584
- gl.uniform1iv(shu.samplerArr, p._samplerArr);
1585
-
1586
- //slice.uniform(gl, shu);
1587
-
1588
- gl.uniform4fv(shu.tileOffsetArr, slice.tileOffsetArr);
1589
- gl.uniform1fv(shu.layerOpacityArr, slice.layerOpacityArr);
1590
- //gl.uniform4fv(shu.visibleExtentOffsetArr, slice.visibleExtentOffsetArr);
1591
-
1592
- gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferHigh);
1593
- gl.vertexAttribPointer(sha.aVertexPositionHigh, this.vertexPositionBufferHigh.itemSize, gl.FLOAT, false, 0, 0);
1560
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferLow);
1561
+ gl.vertexAttribPointer(sha.aVertexPositionLow, this.vertexPositionBufferLow.itemSize, gl.FLOAT, false, 0, 0);
1594
1562
 
1595
- gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferLow);
1596
- gl.vertexAttribPointer(sha.aVertexPositionLow, this.vertexPositionBufferLow.itemSize, gl.FLOAT, false, 0, 0);
1597
-
1598
- gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexTextureCoordBuffer);
1599
- gl.vertexAttribPointer(sha.aTextureCoord, 2, gl.UNSIGNED_SHORT, true, 0, 0);
1600
-
1601
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
1602
- gl.drawElements(gl.TRIANGLE_STRIP, this._indexBuffer.numItems, gl.UNSIGNED_INT, 0);
1603
- }
1563
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
1564
+ gl.drawElements(gl.TRIANGLE_STRIP, this._indexBuffer.numItems, gl.UNSIGNED_INT, 0);
1604
1565
  }
1605
1566
 
1606
1567
  colorPickingRendering(sh, layerSlice, sliceIndex, defaultTexture, isOverlay) {
@@ -1670,19 +1631,11 @@ class Segment {
1670
1631
  }
1671
1632
  }
1672
1633
 
1673
- depthRendering(sh, layerSlice, sliceIndex, defaultTexture, isOverlay) {
1634
+ depthRendering(sh, layerSlice) {
1674
1635
  var gl = this.handler.gl;
1675
1636
  var sha = sh.attributes,
1676
1637
  shu = sh.uniforms;
1677
1638
 
1678
- var pm = this.materials,
1679
- p = this.planet;
1680
-
1681
- // First always draw whole planet base layer segment with solid texture.
1682
- gl.activeTexture(gl.TEXTURE0 + p.SLICE_SIZE);
1683
- gl.bindTexture(gl.TEXTURE_2D, defaultTexture || p.solidTextureOne);
1684
- gl.uniform1i(shu.defaultTexture, p.SLICE_SIZE);
1685
-
1686
1639
  var currHeight;
1687
1640
  if (layerSlice) {
1688
1641
  currHeight = layerSlice[0]._height;
@@ -1690,42 +1643,16 @@ class Segment {
1690
1643
  currHeight = 0;
1691
1644
  }
1692
1645
 
1693
- var slice = this._slices[sliceIndex];
1694
-
1695
- var notEmpty = false;
1696
-
1697
- let len = slice.layers.length;
1698
-
1699
- for (let n = 0; n < len; n++) {
1700
- notEmpty = true;
1701
- p._samplerArr[n] = n;
1702
- gl.activeTexture(gl.TEXTURE0 + n);
1703
- gl.bindTexture(gl.TEXTURE_2D, pm[slice.layers[n]._id].texture || p.transparentTexture);
1704
- }
1705
-
1706
- if (notEmpty || !isOverlay) {
1707
- gl.uniform1i(shu.samplerCount, len);
1708
- gl.uniform1f(shu.height, currHeight);
1709
- gl.uniform1iv(shu.samplerArr, p._samplerArr);
1646
+ gl.uniform1f(shu.height, currHeight);
1710
1647
 
1711
- //slice.uniform(gl, shu);
1648
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferHigh);
1649
+ gl.vertexAttribPointer(sha.aVertexPositionHigh, this.vertexPositionBufferHigh.itemSize, gl.FLOAT, false, 0, 0);
1712
1650
 
1713
- gl.uniform4fv(shu.tileOffsetArr, slice.tileOffsetArr);
1714
- gl.uniform1fv(shu.layerOpacityArr, slice.layerOpacityArr);
1715
- //gl.uniform4fv(shu.visibleExtentOffsetArr, slice.visibleExtentOffsetArr);
1651
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferLow);
1652
+ gl.vertexAttribPointer(sha.aVertexPositionLow, this.vertexPositionBufferLow.itemSize, gl.FLOAT, false, 0, 0);
1716
1653
 
1717
- gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferHigh);
1718
- gl.vertexAttribPointer(sha.aVertexPositionHigh, this.vertexPositionBufferHigh.itemSize, gl.FLOAT, false, 0, 0);
1719
-
1720
- gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexPositionBufferLow);
1721
- gl.vertexAttribPointer(sha.aVertexPositionLow, this.vertexPositionBufferLow.itemSize, gl.FLOAT, false, 0, 0);
1722
-
1723
- gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexTextureCoordBuffer);
1724
- gl.vertexAttribPointer(sha.aTextureCoord, 2, gl.UNSIGNED_SHORT, true, 0, 0);
1725
-
1726
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
1727
- gl.drawElements(gl.TRIANGLE_STRIP, this._indexBuffer.numItems, gl.UNSIGNED_INT, 0);
1728
- }
1654
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
1655
+ gl.drawElements(gl.TRIANGLE_STRIP, this._indexBuffer.numItems, gl.UNSIGNED_INT, 0);
1729
1656
  }
1730
1657
 
1731
1658
  _getIndexBuffer() {