itowns 2.45.1 → 2.45.2-next.1

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 (224) hide show
  1. package/dist/455.js +1 -1
  2. package/dist/455.js.map +1 -1
  3. package/dist/debug.js +1 -1
  4. package/dist/debug.js.LICENSE.txt +8 -2
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +1 -1
  7. package/dist/itowns.js.LICENSE.txt +1 -1
  8. package/dist/itowns.js.map +1 -1
  9. package/dist/itowns_lasparser.js +1 -1
  10. package/dist/itowns_lasparser.js.map +1 -1
  11. package/dist/itowns_lasworker.js +1 -1
  12. package/dist/itowns_lasworker.js.map +1 -1
  13. package/dist/itowns_potree2worker.js +1 -1
  14. package/dist/itowns_potree2worker.js.map +1 -1
  15. package/dist/itowns_widgets.js +1 -1
  16. package/dist/itowns_widgets.js.map +1 -1
  17. package/examples/copc_simple_loader.html +3 -3
  18. package/examples/entwine_3d_loader.html +2 -2
  19. package/examples/entwine_simple_loader.html +10 -6
  20. package/examples/potree2_25d_map.html +2 -2
  21. package/examples/potree_25d_map.html +2 -2
  22. package/examples/potree_3d_map.html +2 -2
  23. package/examples/view_3d_map_webxr.html +2 -5
  24. package/lib/Controls/FirstPersonControls.d.ts +90 -0
  25. package/lib/Controls/FlyControls.d.ts +36 -0
  26. package/lib/Controls/GlobeControls.d.ts +274 -0
  27. package/lib/Controls/PlanarControls.d.ts +339 -0
  28. package/lib/Controls/StateControl.d.ts +140 -0
  29. package/lib/Controls/StreetControls.d.ts +134 -0
  30. package/lib/Controls/VRControls.d.ts +56 -0
  31. package/lib/Controls/VRControls.js +409 -0
  32. package/lib/Converter/Feature2Mesh.d.ts +42 -0
  33. package/lib/Converter/Feature2Texture.d.ts +5 -0
  34. package/lib/Converter/convertToTile.d.ts +5 -0
  35. package/lib/Converter/convertToTile.js +2 -2
  36. package/lib/Converter/textureConverter.d.ts +4 -0
  37. package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
  38. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
  39. package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
  40. package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
  41. package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
  42. package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
  43. package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
  44. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
  45. package/lib/Core/AnimationPlayer.d.ts +53 -0
  46. package/lib/Core/CopcNode.d.ts +68 -0
  47. package/lib/Core/CopcNode.js +57 -74
  48. package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
  49. package/lib/Core/EntwinePointTileNode.d.ts +59 -0
  50. package/lib/Core/EntwinePointTileNode.js +16 -41
  51. package/lib/Core/Feature.d.ts +323 -0
  52. package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
  53. package/lib/Core/Label.d.ts +86 -0
  54. package/lib/Core/MainLoop.d.ts +23 -0
  55. package/lib/Core/Picking.d.ts +6 -0
  56. package/lib/Core/Picking.js +4 -0
  57. package/lib/Core/PointCloudNode.d.ts +16 -0
  58. package/lib/Core/PointCloudNode.js +34 -4
  59. package/lib/Core/Potree2Node.d.ts +11 -0
  60. package/lib/Core/Potree2Node.js +5 -60
  61. package/lib/Core/Potree2PointAttributes.d.ts +97 -0
  62. package/lib/Core/PotreeNode.d.ts +14 -0
  63. package/lib/Core/PotreeNode.js +28 -18
  64. package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
  65. package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
  66. package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
  67. package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
  68. package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
  69. package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
  70. package/lib/Core/Prefab/GlobeView.d.ts +65 -0
  71. package/lib/Core/Prefab/GlobeView.js +9 -0
  72. package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
  73. package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
  74. package/lib/Core/Prefab/PlanarView.d.ts +33 -0
  75. package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
  76. package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
  77. package/lib/Core/Scheduler/Cache.d.ts +25 -0
  78. package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
  79. package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
  80. package/lib/Core/Style.d.ts +248 -0
  81. package/lib/Core/StyleOptions.d.ts +455 -0
  82. package/lib/Core/System/Capabilities.d.ts +9 -0
  83. package/lib/Core/Tile/Tile.d.ts +70 -0
  84. package/lib/Core/Tile/TileGrid.d.ts +12 -0
  85. package/lib/Core/TileGeometry.d.ts +46 -0
  86. package/lib/Core/TileMesh.d.ts +50 -0
  87. package/lib/Core/TileMesh.js +2 -4
  88. package/lib/Core/View.d.ts +403 -0
  89. package/lib/Core/View.js +1 -7
  90. package/lib/Layer/C3DTilesLayer.d.ts +140 -0
  91. package/lib/Layer/ColorLayer.d.ts +128 -0
  92. package/lib/Layer/ColorLayer.js +4 -4
  93. package/lib/Layer/CopcLayer.d.ts +42 -0
  94. package/lib/Layer/CopcLayer.js +3 -6
  95. package/lib/Layer/ElevationLayer.d.ts +96 -0
  96. package/lib/Layer/ElevationLayer.js +3 -3
  97. package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
  98. package/lib/Layer/EntwinePointTileLayer.js +4 -3
  99. package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
  100. package/lib/Layer/GeoidLayer.d.ts +41 -0
  101. package/lib/Layer/GeometryLayer.d.ts +120 -0
  102. package/lib/Layer/InfoLayer.d.ts +24 -0
  103. package/lib/Layer/InfoLayer.js +1 -1
  104. package/lib/Layer/LabelLayer.d.ts +93 -0
  105. package/lib/Layer/LabelLayer.js +2 -2
  106. package/lib/Layer/Layer.d.ts +185 -0
  107. package/lib/Layer/LayerUpdateState.d.ts +24 -0
  108. package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
  109. package/lib/Layer/LayerUpdateStrategy.js +2 -7
  110. package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
  111. package/lib/Layer/OGC3DTilesLayer.js +21 -0
  112. package/lib/Layer/OrientedImageLayer.d.ts +53 -0
  113. package/lib/Layer/PointCloudLayer.d.ts +103 -0
  114. package/lib/Layer/PointCloudLayer.js +8 -11
  115. package/lib/Layer/Potree2Layer.d.ts +56 -0
  116. package/lib/Layer/Potree2Layer.js +0 -2
  117. package/lib/Layer/PotreeLayer.d.ts +55 -0
  118. package/lib/Layer/RasterLayer.d.ts +8 -0
  119. package/lib/Layer/RasterLayer.js +2 -2
  120. package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
  121. package/lib/Layer/ReferencingLayerProperties.js +0 -12
  122. package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
  123. package/lib/Layer/TiledGeometryLayer.js +4 -3
  124. package/lib/Main.d.ts +89 -0
  125. package/lib/Main.js +3 -1
  126. package/lib/Parser/B3dmParser.d.ts +26 -0
  127. package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
  128. package/lib/Parser/GDFParser.d.ts +24 -0
  129. package/lib/Parser/GTXParser.d.ts +28 -0
  130. package/lib/Parser/GeoJsonParser.d.ts +12 -0
  131. package/lib/Parser/GpxParser.d.ts +12 -0
  132. package/lib/Parser/ISGParser.d.ts +23 -0
  133. package/lib/Parser/KMLParser.d.ts +12 -0
  134. package/lib/Parser/LASParser.d.ts +61 -0
  135. package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
  136. package/lib/Parser/PntsParser.d.ts +4 -0
  137. package/lib/Parser/Potree2BinParser.d.ts +8 -0
  138. package/lib/Parser/PotreeBinParser.d.ts +4 -0
  139. package/lib/Parser/PotreeCinParser.d.ts +4 -0
  140. package/lib/Parser/ShapefileParser.d.ts +25 -0
  141. package/lib/Parser/VectorTileParser.d.ts +34 -0
  142. package/lib/Parser/XbilParser.d.ts +18 -0
  143. package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
  144. package/lib/Parser/iGLTFLoader.d.ts +104 -0
  145. package/lib/Process/3dTilesProcessing.d.ts +43 -0
  146. package/lib/Process/FeatureProcessing.d.ts +4 -0
  147. package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
  148. package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
  149. package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
  150. package/lib/Process/handlerNodeError.d.ts +1 -0
  151. package/lib/Provider/3dTilesProvider.d.ts +7 -0
  152. package/lib/Provider/DataSourceProvider.d.ts +4 -0
  153. package/lib/Provider/Fetcher.d.ts +101 -0
  154. package/lib/Provider/PointCloudProvider.d.ts +4 -0
  155. package/lib/Provider/TileProvider.d.ts +4 -0
  156. package/lib/Provider/URLBuilder.d.ts +28 -0
  157. package/lib/Renderer/Camera.d.ts +95 -0
  158. package/lib/Renderer/Color.d.ts +3 -0
  159. package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
  160. package/lib/Renderer/ColorLayersOrdering.js +2 -2
  161. package/lib/Renderer/CommonMaterial.d.ts +6 -0
  162. package/lib/Renderer/Label2DRenderer.d.ts +31 -0
  163. package/lib/Renderer/LayeredMaterial.d.ts +121 -0
  164. package/lib/Renderer/LayeredMaterial.js +221 -141
  165. package/lib/Renderer/OBB.d.ts +65 -0
  166. package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
  167. package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
  168. package/lib/Renderer/PointsMaterial.d.ts +226 -0
  169. package/lib/Renderer/PointsMaterial.js +60 -22
  170. package/lib/Renderer/RasterTile.d.ts +53 -0
  171. package/lib/Renderer/RasterTile.js +8 -9
  172. package/lib/Renderer/RenderMode.d.ts +11 -0
  173. package/lib/Renderer/RenderMode.js +1 -0
  174. package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
  175. package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
  176. package/lib/Renderer/WebXR.d.ts +33 -0
  177. package/lib/Renderer/WebXR.js +128 -47
  178. package/lib/Renderer/c3DEngine.d.ts +55 -0
  179. package/lib/Renderer/c3DEngine.js +5 -1
  180. package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
  181. package/lib/Source/C3DTilesIonSource.d.ts +31 -0
  182. package/lib/Source/C3DTilesSource.d.ts +17 -0
  183. package/lib/Source/CopcSource.d.ts +79 -0
  184. package/lib/Source/EntwinePointTileSource.d.ts +40 -0
  185. package/lib/Source/EntwinePointTileSource.js +0 -5
  186. package/lib/Source/FileSource.d.ts +118 -0
  187. package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
  188. package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
  189. package/lib/Source/OGC3DTilesSource.d.ts +21 -0
  190. package/lib/Source/OrientedImageSource.d.ts +48 -0
  191. package/lib/Source/Potree2Source.d.ts +157 -0
  192. package/lib/Source/PotreeSource.d.ts +69 -0
  193. package/lib/Source/Source.d.ts +122 -0
  194. package/lib/Source/TMSSource.d.ts +77 -0
  195. package/lib/Source/VectorTilesSource.d.ts +56 -0
  196. package/lib/Source/WFSSource.d.ts +110 -0
  197. package/lib/Source/WMSSource.d.ts +85 -0
  198. package/lib/Source/WMTSSource.d.ts +65 -0
  199. package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
  200. package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
  201. package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
  202. package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
  203. package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
  204. package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
  205. package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
  206. package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
  207. package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
  208. package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
  209. package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
  210. package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
  211. package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
  212. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
  213. package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
  214. package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
  215. package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
  216. package/lib/Utils/CameraUtils.d.ts +132 -0
  217. package/lib/Utils/DEMUtils.d.ts +84 -0
  218. package/lib/Utils/DEMUtils.js +2 -2
  219. package/lib/Utils/FeaturesUtils.d.ts +17 -0
  220. package/lib/Utils/Gradients.d.ts +13 -0
  221. package/lib/Utils/ThreeUtils.d.ts +14 -0
  222. package/lib/Utils/placeObjectOnGround.d.ts +28 -0
  223. package/lib/global.d.js +0 -0
  224. package/package.json +18 -15
@@ -0,0 +1,226 @@
1
+ export namespace PNTS_MODE {
2
+ let COLOR: number;
3
+ let INTENSITY: number;
4
+ let CLASSIFICATION: number;
5
+ let ELEVATION: number;
6
+ let RETURN_NUMBER: number;
7
+ let RETURN_TYPE: number;
8
+ let RETURN_COUNT: number;
9
+ let POINT_SOURCE_ID: number;
10
+ let SCAN_ANGLE: number;
11
+ let NORMAL: number;
12
+ }
13
+ export namespace PNTS_SHAPE {
14
+ let CIRCLE: number;
15
+ let SQUARE: number;
16
+ }
17
+ export namespace PNTS_SIZE_MODE {
18
+ let VALUE: number;
19
+ let ATTENUATED: number;
20
+ }
21
+ export namespace ClassificationScheme {
22
+ let DEFAULT: {
23
+ 0: {
24
+ visible: boolean;
25
+ name: string;
26
+ color: THREE.Color;
27
+ opacity: number;
28
+ };
29
+ 1: {
30
+ visible: boolean;
31
+ name: string;
32
+ color: THREE.Color;
33
+ opacity: number;
34
+ };
35
+ 2: {
36
+ visible: boolean;
37
+ name: string;
38
+ color: THREE.Color;
39
+ opacity: number;
40
+ };
41
+ 3: {
42
+ visible: boolean;
43
+ name: string;
44
+ color: THREE.Color;
45
+ opacity: number;
46
+ };
47
+ 4: {
48
+ visible: boolean;
49
+ name: string;
50
+ color: THREE.Color;
51
+ opacity: number;
52
+ };
53
+ 5: {
54
+ visible: boolean;
55
+ name: string;
56
+ color: THREE.Color;
57
+ opacity: number;
58
+ };
59
+ 6: {
60
+ visible: boolean;
61
+ name: string;
62
+ color: THREE.Color;
63
+ opacity: number;
64
+ };
65
+ 7: {
66
+ visible: boolean;
67
+ name: string;
68
+ color: THREE.Color;
69
+ opacity: number;
70
+ };
71
+ 8: {
72
+ visible: boolean;
73
+ name: string;
74
+ color: THREE.Color;
75
+ opacity: number;
76
+ };
77
+ 9: {
78
+ visible: boolean;
79
+ name: string;
80
+ color: THREE.Color;
81
+ opacity: number;
82
+ };
83
+ 10: {
84
+ visible: boolean;
85
+ name: string;
86
+ color: THREE.Color;
87
+ opacity: number;
88
+ };
89
+ 11: {
90
+ visible: boolean;
91
+ name: string;
92
+ color: THREE.Color;
93
+ opacity: number;
94
+ };
95
+ 12: {
96
+ visible: boolean;
97
+ name: string;
98
+ color: THREE.Color;
99
+ opacity: number;
100
+ };
101
+ DEFAULT: {
102
+ visible: boolean;
103
+ name: string;
104
+ color: THREE.Color;
105
+ opacity: number;
106
+ };
107
+ };
108
+ }
109
+ export default PointsMaterial;
110
+ /**
111
+ * Every lidar point can have a classification assigned to it that defines
112
+ * the type of object that has reflected the laser pulse. Lidar points can be
113
+ * classified into a number of categories including bare earth or ground,
114
+ * top of canopy, and water. The different classes are defined using numeric
115
+ * integer codes in the files.
116
+ */
117
+ export type Classification = {
118
+ /**
119
+ * - category visibility,
120
+ */
121
+ visible: boolean;
122
+ /**
123
+ * - category name,
124
+ */
125
+ name: string;
126
+ /**
127
+ * - category color,
128
+ */
129
+ color: THREE.Color;
130
+ /**
131
+ * - category opacity,
132
+ */
133
+ opacity: number;
134
+ };
135
+ import * as THREE from 'three';
136
+ declare class PointsMaterial extends THREE.ShaderMaterial {
137
+ /**
138
+ * @class PointsMaterial
139
+ * @param {object} [options={}] The options
140
+ * @param {number} [options.size=1] point size
141
+ * @param {number} [options.mode=PNTS_MODE.COLOR] display mode.
142
+ * @param {number} [options.shape=PNTS_SHAPE.CIRCLE] rendered points shape.
143
+ * @param {THREE.Vector4} [options.overlayColor=new THREE.Vector4(0, 0, 0, 0)] overlay color.
144
+
145
+ * @param {Scheme} [options.classificationScheme] LUT for point classification colorization.
146
+ * @param {Scheme} [options.discreteScheme] LUT for other discret point values colorization.
147
+ * @param {string} [options.gradient] Descrition of the gradient to use for continuous point values.
148
+ * (Default value will be the 'SPECTRAL' gradient from Utils/Gradients)
149
+ * @param {number} [options.sizeMode=PNTS_SIZE_MODE.VALUE] point cloud size mode. Only 'VALUE' or 'ATTENUATED' are possible. VALUE use constant size, ATTENUATED compute size depending on distance from point to camera.
150
+ * @param {number} [options.minAttenuatedSize=3] minimum scale used by 'ATTENUATED' size mode
151
+ * @param {number} [options.maxAttenuatedSize=10] maximum scale used by 'ATTENUATED' size mode
152
+ *
153
+ * @property {THREE.Vector2} [options.intensityRange=new THREE.Vector2(1, 65536)] intensity range (default value will be [1, 65536] if not defined at Layer level).
154
+ * @property {THREE.Vector2} [options.elevationRange=new THREE.Vector2(0, 1000)] elevation range (default value will be [0, 1000] if not defined at Layer level).
155
+ * @property {THREE.Vector2} [options.angleRange=new THREE.Vector2(-90, 90)] scan angle range (default value will be [-90, 90] if not defined at Layer level).
156
+ * @property {Scheme} classificationScheme - Color scheme for point classification values.
157
+ * @property {Scheme} discreteScheme - Color scheme for all other discrete values.
158
+ * @property {object} gradients - Descriptions of all available gradients.
159
+ * @property {object} gradient - Description of the gradient to use for display.
160
+ * @property {THREE.CanvasTexture} gradientTexture - The texture generate from the choosen gradient.
161
+ *
162
+ * @example
163
+ * // change color category classification
164
+ * const pointMaterial = new PointsMaterial();
165
+ * pointMaterial.classification[3].color.setStyle('red');
166
+ * pointMaterial.recomputeClassification();
167
+ */
168
+ constructor(options?: {
169
+ size?: number | undefined;
170
+ mode?: number | undefined;
171
+ shape?: number | undefined;
172
+ overlayColor?: THREE.Vector4 | undefined;
173
+ classificationScheme?: any;
174
+ discreteScheme?: any;
175
+ gradient?: string | undefined;
176
+ sizeMode?: number | undefined;
177
+ minAttenuatedSize?: number | undefined;
178
+ maxAttenuatedSize?: number | undefined;
179
+ });
180
+ gradients: any;
181
+ gradientTexture: THREE.CanvasTexture;
182
+ /** @param {number} size */
183
+ set size(size: number);
184
+ /** @returns {number} */
185
+ get size(): number;
186
+ classificationScheme: any;
187
+ discreteScheme: any;
188
+ set gradient(value: any);
189
+ /**
190
+ * Copy the parameters from the passed material into this material.
191
+ * @override
192
+ * @param {THREE.PointsMaterial} source
193
+ * @returns {this}
194
+ */
195
+ override copy(source: THREE.PointsMaterial): this;
196
+ /** @param {THREE.Texture | null} map */
197
+ set map(map: THREE.Texture | null);
198
+ /** @returns {THREE.Texture | null} */
199
+ get map(): THREE.Texture | null;
200
+ /** @param {THREE.Texture | null} map */
201
+ set alphaMap(map: THREE.Texture | null);
202
+ /** @returns {THREE.Texture | null} */
203
+ get alphaMap(): THREE.Texture | null;
204
+ /** @param {boolean} value */
205
+ set sizeAttenuation(value: boolean);
206
+ /** @returns {boolean} */
207
+ get sizeAttenuation(): boolean;
208
+ /** @param {THREE.Color} color */
209
+ set color(color: THREE.Color);
210
+ /** @returns {THREE.Color} */
211
+ get color(): THREE.Color;
212
+ sizeMode: number | undefined;
213
+ /** @param {number} gamma */
214
+ set gamma(gamma: number);
215
+ /** @returns {number} */
216
+ get gamma(): number;
217
+ /** @param {number} ambientBoost */
218
+ set ambientBoost(ambientBoost: number);
219
+ /** @returns {number} */
220
+ get ambientBoost(): number;
221
+ recomputeClassification(): void;
222
+ recomputeDiscreteTexture(): void;
223
+ recomputeVisibilityTexture(): void;
224
+ enablePicking(picking: any): void;
225
+ picking: any;
226
+ }
@@ -1,8 +1,8 @@
1
1
  import * as THREE from 'three';
2
2
  /* babel-plugin-inline-import './Shader/PointsVS.glsl' */
3
- const PointsVS = "#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec4 vColor; // color_pars_vertex\n\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\n\n#define NB_CLASS 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\nvoid main() {\n vColor = vec4(1.0);\n if (picking) {\n vColor = unique_id;\n } else {\n if (mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification/255., 0.5);\n vColor = texture2D(classificationTexture, uv);\n } else if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n#if defined(USE_COLOR)\n vColor.rgb = color.rgb;\n#elif defined(USE_COLOR_ALPHA)\n vColor = color;\n#endif\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, NB_CLASS)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float z = (modelMatrix * vec4(position, 1.0)).z;\n float i = (z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n#define USE_COLOR_ALPHA\n#include <morphcolor_vertex>\n#include <begin_vertex>\n#include <morphtarget_vertex>\n#include <project_vertex>\n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#include <logdepthbuf_vertex>\n#include <clipping_planes_vertex>\n#include <worldpos_vertex>\n#include <fog_vertex>\n}\n";
3
+ const PointsVS = "#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec4 vColor; // color_pars_vertex\n\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\n\n#define SOURCE_ID_GROUP 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform sampler2D visibilityTexture;\n\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\nvoid main() {\n vec2 uv = vec2(classification/255., 0.5);\n\n vColor = vec4(1.0);\n if (picking) {\n vColor = unique_id;\n } else {\n if (mode == PNTS_MODE_CLASSIFICATION) {\n vColor = texture2D(classificationTexture, uv);\n } else if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n#if defined(USE_COLOR)\n vColor.rgb = color.rgb;\n#elif defined(USE_COLOR_ALPHA)\n vColor = color;\n#endif\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, SOURCE_ID_GROUP)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float z = (modelMatrix * vec4(position, 1.0)).z;\n float i = (z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n if (texture2D(visibilityTexture, uv).r == 0.) {\n vColor.a = 0.;\n }\n\n#define USE_COLOR_ALPHA\n#include <morphcolor_vertex>\n#include <begin_vertex>\n#include <morphtarget_vertex>\n#include <project_vertex>\n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#include <logdepthbuf_vertex>\n#include <clipping_planes_vertex>\n#include <worldpos_vertex>\n#include <fog_vertex>\n}\n";
4
4
  /* babel-plugin-inline-import './Shader/PointsFS.glsl' */
5
- const PointsFS = "#define USE_COLOR_ALPHA\n\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n\n// Early discard (clipping planes and shape)\n#include <clipping_planes_fragment>\n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5)) {\n discard;\n }\n }\n\n#include <logdepthbuf_fragment>\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n#include <map_particle_fragment>\n#include <color_fragment>\n\n#include <alphatest_fragment>\n#include <alphahash_fragment>\n\n vec3 outgoingLight = diffuseColor.rgb;\n#include <opaque_fragment> // gl_FragColor\n#include <tonemapping_fragment>\n#include <fog_fragment>\n#include <premultiplied_alpha_fragment>\n\n}\n";
5
+ const PointsFS = "#define USE_COLOR_ALPHA\n\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform float gamma;\nuniform float ambientBoost;\n\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n\n// Early discard (clipping planes and shape)\n#include <clipping_planes_fragment>\n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5)) {\n discard;\n }\n }\n\n#include <logdepthbuf_fragment>\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n#include <map_particle_fragment>\n#include <color_fragment>\n\n#include <alphatest_fragment>\n#include <alphahash_fragment>\n\n vec3 outgoingLight = diffuseColor.rgb;\n \n outgoingLight = max(outgoingLight, vec3(ambientBoost));\n \n outgoingLight = pow(outgoingLight, vec3(1.0 / gamma));\n \n#include <opaque_fragment> // gl_FragColor\n#include <tonemapping_fragment>\n#include <fog_fragment>\n#include <premultiplied_alpha_fragment>\n\n}\n";
6
6
  import CommonMaterial from "./CommonMaterial.js";
7
7
  import Gradients from "../Utils/Gradients.js";
8
8
  export const PNTS_MODE = {
@@ -218,7 +218,6 @@ function generateGradientTexture(gradient) {
218
218
  return texture;
219
219
  }
220
220
  function recomputeTexture(scheme, texture, nbClass) {
221
- let needTransparency;
222
221
  const data = texture.image.data;
223
222
  const width = texture.image.width;
224
223
  if (!nbClass) {
@@ -227,18 +226,14 @@ function recomputeTexture(scheme, texture, nbClass) {
227
226
  for (let i = 0; i < width; i++) {
228
227
  let color;
229
228
  let opacity;
230
- let visible = true;
231
229
  if (scheme[i]) {
232
230
  color = scheme[i].color;
233
- visible = scheme[i].visible;
234
231
  opacity = scheme[i].opacity;
235
232
  } else if (scheme[i % nbClass]) {
236
233
  color = scheme[i % nbClass].color;
237
- visible = scheme[i % nbClass].visible;
238
234
  opacity = scheme[i % nbClass].opacity;
239
235
  } else if (scheme.DEFAULT) {
240
236
  color = scheme.DEFAULT.color;
241
- visible = scheme.DEFAULT.visible;
242
237
  opacity = scheme.DEFAULT.opacity;
243
238
  } else {
244
239
  color = white;
@@ -248,11 +243,9 @@ function recomputeTexture(scheme, texture, nbClass) {
248
243
  data[j + 0] = parseInt(255 * color.r, 10);
249
244
  data[j + 1] = parseInt(255 * color.g, 10);
250
245
  data[j + 2] = parseInt(255 * color.b, 10);
251
- data[j + 3] = visible ? parseInt(255 * opacity, 10) : 0;
252
- needTransparency = needTransparency || opacity < 1 || !visible;
246
+ data[j + 3] = parseInt(255 * opacity, 10);
253
247
  }
254
248
  texture.needsUpdate = true;
255
- return needTransparency;
256
249
  }
257
250
  class PointsMaterial extends THREE.ShaderMaterial {
258
251
  /**
@@ -305,12 +298,15 @@ class PointsMaterial extends THREE.ShaderMaterial {
305
298
  minAttenuatedSize = 3,
306
299
  maxAttenuatedSize = 10,
307
300
  gradient,
301
+ gamma = 1.0,
308
302
  scale = 0.05 * 0.5 / Math.tan(1.0 / 2.0),
303
+ ambientBoost = 0.0,
309
304
  ...materialOptions
310
305
  } = options;
311
306
  super({
312
307
  ...materialOptions,
313
308
  fog: true,
309
+ transparent: true,
314
310
  precision: 'highp',
315
311
  vertexColors: true
316
312
  });
@@ -319,7 +315,6 @@ class PointsMaterial extends THREE.ShaderMaterial {
319
315
  THREE.UniformsLib.points, THREE.UniformsLib.fog]);
320
316
  this.vertexShader = PointsVS;
321
317
  this.fragmentShader = PointsFS;
322
- this.userData.needTransparency = {};
323
318
  this.gradients = gradients;
324
319
  this.gradientTexture = new THREE.CanvasTexture();
325
320
  CommonMaterial.setDefineMapping(this, 'PNTS_MODE', PNTS_MODE);
@@ -337,6 +332,8 @@ class PointsMaterial extends THREE.ShaderMaterial {
337
332
  CommonMaterial.setUniformProperty(this, 'scale', scale);
338
333
  CommonMaterial.setUniformProperty(this, 'minAttenuatedSize', minAttenuatedSize);
339
334
  CommonMaterial.setUniformProperty(this, 'maxAttenuatedSize', maxAttenuatedSize);
335
+ CommonMaterial.setUniformProperty(this, 'gamma', gamma);
336
+ CommonMaterial.setUniformProperty(this, 'ambientBoost', ambientBoost);
340
337
 
341
338
  // add classification texture to apply classification lut.
342
339
  const data = new Uint8Array(256 * 4);
@@ -352,6 +349,13 @@ class PointsMaterial extends THREE.ShaderMaterial {
352
349
  textureLUT.magFilter = THREE.NearestFilter;
353
350
  CommonMaterial.setUniformProperty(this, 'discreteTexture', textureLUT);
354
351
 
352
+ // add texture to apply visibility.
353
+ const dataVisi = new Uint8Array(256 * 1);
354
+ const textureVisi = new THREE.DataTexture(dataVisi, 256, 1, THREE.RedFormat);
355
+ textureVisi.needsUpdate = true;
356
+ textureVisi.magFilter = THREE.NearestFilter;
357
+ CommonMaterial.setUniformProperty(this, 'visibilityTexture', textureVisi);
358
+
355
359
  // Classification and other discrete values scheme
356
360
  this.classificationScheme = classificationScheme;
357
361
  this.discreteScheme = discreteScheme;
@@ -359,6 +363,7 @@ class PointsMaterial extends THREE.ShaderMaterial {
359
363
  // Update classification and discrete Texture
360
364
  this.recomputeClassification();
361
365
  this.recomputeDiscreteTexture();
366
+ this.recomputeVisibilityTexture();
362
367
 
363
368
  // Gradient texture for continuous values
364
369
  this.gradient = gradient;
@@ -372,9 +377,6 @@ class PointsMaterial extends THREE.ShaderMaterial {
372
377
  * @returns {this}
373
378
  */
374
379
  copy(source) {
375
- // Manually copy this needTransparency if source doesn't have one. Prevents losing it when copying a three
376
- // PointsMaterial into this PointsMaterial
377
- const needTransparency = source.userData.needTransparency !== undefined ? source.userData.needTransparency : this.userData.needTransparency;
378
380
  if (source.isShaderMaterial) {
379
381
  super.copy(source);
380
382
  } else {
@@ -388,7 +390,6 @@ class PointsMaterial extends THREE.ShaderMaterial {
388
390
  this.size = source.size;
389
391
  this.sizeAttenuation = source.sizeAttenuation;
390
392
  this.fog = source.fog;
391
- this.userData.needTransparency = needTransparency;
392
393
  return this;
393
394
  }
394
395
 
@@ -455,20 +456,57 @@ class PointsMaterial extends THREE.ShaderMaterial {
455
456
  set sizeAttenuation(value) {
456
457
  this.sizeMode = value ? PNTS_SIZE_MODE.ATTENUATED : PNTS_SIZE_MODE.VALUE;
457
458
  }
459
+
460
+ /** @returns {number} */
461
+ get gamma() {
462
+ return this.uniforms.gamma.value;
463
+ }
464
+
465
+ /** @param {number} gamma */
466
+ set gamma(gamma) {
467
+ this.uniforms.gamma.value = gamma;
468
+ }
469
+
470
+ /** @returns {number} */
471
+ get ambientBoost() {
472
+ return this.uniforms.ambientBoost.value;
473
+ }
474
+
475
+ /** @param {number} ambientBoost */
476
+ set ambientBoost(ambientBoost) {
477
+ this.uniforms.ambientBoost.value = ambientBoost;
478
+ }
458
479
  recomputeClassification() {
459
- const needTransparency = recomputeTexture(this.classificationScheme, this.classificationTexture, 256);
460
- this.userData.needTransparency[PNTS_MODE.CLASSIFICATION] = needTransparency;
480
+ recomputeTexture(this.classificationScheme, this.classificationTexture, 256);
461
481
  this.dispatchEvent({
462
482
  type: 'material_property_changed',
463
483
  target: this.uniforms
464
484
  });
465
485
  }
466
486
  recomputeDiscreteTexture() {
467
- const needTransparency = recomputeTexture(this.discreteScheme, this.discreteTexture);
468
- this.userData.needTransparency[PNTS_MODE.RETURN_NUMBER] = needTransparency;
469
- this.userData.needTransparency[PNTS_MODE.RETURN_TYPE] = needTransparency;
470
- this.userData.needTransparency[PNTS_MODE.RETURN_COUNT] = needTransparency;
471
- this.userData.needTransparency[PNTS_MODE.POINT_SOURCE_ID] = needTransparency;
487
+ recomputeTexture(this.discreteScheme, this.discreteTexture);
488
+ this.dispatchEvent({
489
+ type: 'material_property_changed',
490
+ target: this.uniforms
491
+ });
492
+ }
493
+ recomputeVisibilityTexture() {
494
+ const texture = this.visibilityTexture;
495
+ const scheme = this.classificationScheme;
496
+ const data = texture.image.data;
497
+ const width = texture.image.width;
498
+ for (let i = 0; i < width; i++) {
499
+ let visible;
500
+ if (scheme[i]) {
501
+ visible = scheme[i].visible;
502
+ } else if (scheme.DEFAULT) {
503
+ visible = scheme.DEFAULT.visible;
504
+ } else {
505
+ visible = true;
506
+ }
507
+ data[i] = visible ? 255 : 0;
508
+ }
509
+ texture.needsUpdate = true;
472
510
  this.dispatchEvent({
473
511
  type: 'material_property_changed',
474
512
  target: this.uniforms
@@ -0,0 +1,53 @@
1
+ export const EMPTY_TEXTURE_ZOOM: -1;
2
+ /**
3
+ * A `RasterTile` is part of raster {@link Layer} data.
4
+ * This part is a spatial subdivision of the extent of a layer.
5
+ * In the `RasterTile`, The data are converted on three.js textures.
6
+ * This `RasterTile` textures are assigned to a `LayeredMaterial`.
7
+ * This material is applied on terrain (TileMesh).
8
+ * The color textures are mapped to color the terrain.
9
+ * The elevation textures are used to displace vertex terrain.
10
+ *
11
+ * @class RasterTile
12
+ */
13
+ export class RasterTile extends THREE.EventDispatcher<any> {
14
+ constructor(layer: any);
15
+ layer: any;
16
+ crs: any;
17
+ textures: any[];
18
+ offsetScales: any[];
19
+ level: number;
20
+ needsUpdate: boolean;
21
+ _handlerCBEvent: () => void;
22
+ get id(): any;
23
+ get opacity(): any;
24
+ get visible(): any;
25
+ initFromParent(parent: any, extents: any): void;
26
+ sortBestParentTextures(textures: any): any;
27
+ disposeRedrawnTextures(newTextures: any): void;
28
+ dispose(removeEvent?: boolean): void;
29
+ _listeners: {} | undefined;
30
+ disposeAtIndexes(indexes: any): void;
31
+ setTexture(index: any, texture: any, offsetScale: any): void;
32
+ setTextures(textures: any, pitchs: any): void;
33
+ shouldWriteTextureAtIndex(index: any, texture: any): any;
34
+ }
35
+ export class RasterColorTile extends RasterTile {
36
+ get effect_type(): any;
37
+ get effect_parameter(): any;
38
+ get transparent(): any;
39
+ }
40
+ export class RasterElevationTile extends RasterTile {
41
+ scaleFactor: number;
42
+ min: any;
43
+ max: any;
44
+ bias: any;
45
+ mode: any;
46
+ zmin: any;
47
+ zmax: any;
48
+ get scale(): number;
49
+ dispose(removeEvent: any): void;
50
+ updateMinMaxElevation(): void;
51
+ replaceNoDataValueFromTexture(texture: any): void;
52
+ }
53
+ import * as THREE from 'three';
@@ -24,8 +24,8 @@ function getIndiceWithPitch(i, pitch, w) {
24
24
  *
25
25
  * @class RasterTile
26
26
  */
27
- class RasterTile extends THREE.EventDispatcher {
28
- constructor(material, layer) {
27
+ export class RasterTile extends THREE.EventDispatcher {
28
+ constructor(layer) {
29
29
  super();
30
30
  this.layer = layer;
31
31
  this.crs = layer.parent.tileMatrixSets.indexOf(layer.crs);
@@ -35,9 +35,9 @@ class RasterTile extends THREE.EventDispatcher {
35
35
  this.textures = [];
36
36
  this.offsetScales = [];
37
37
  this.level = EMPTY_TEXTURE_ZOOM;
38
- this.material = material;
38
+ this.needsUpdate = false;
39
39
  this._handlerCBEvent = () => {
40
- this.material.layersNeedUpdate = true;
40
+ this.needsUpdate = true;
41
41
  };
42
42
  layer.addEventListener('visible-property-changed', this._handlerCBEvent);
43
43
  layer.addEventListener('opacity-property-changed', this._handlerCBEvent);
@@ -105,14 +105,14 @@ class RasterTile extends THREE.EventDispatcher {
105
105
  texture.dispose();
106
106
  }
107
107
  }
108
- this.material.layersNeedUpdate = true;
108
+ this.needsUpdate = true;
109
109
  }
110
110
  setTexture(index, texture, offsetScale) {
111
111
  if (this.shouldWriteTextureAtIndex(index, texture)) {
112
112
  this.level = texture && texture.extent ? texture.extent.zoom : this.level;
113
113
  this.textures[index] = texture || null;
114
114
  this.offsetScales[index] = offsetScale;
115
- this.material.layersNeedUpdate = true;
115
+ this.needsUpdate = true;
116
116
  }
117
117
  }
118
118
  setTextures(textures, pitchs) {
@@ -126,7 +126,6 @@ class RasterTile extends THREE.EventDispatcher {
126
126
  return !this.textures[index] || texture && texture.isTexture;
127
127
  }
128
128
  }
129
- export default RasterTile;
130
129
  export class RasterColorTile extends RasterTile {
131
130
  get effect_type() {
132
131
  return this.layer.effect_type;
@@ -139,8 +138,8 @@ export class RasterColorTile extends RasterTile {
139
138
  }
140
139
  }
141
140
  export class RasterElevationTile extends RasterTile {
142
- constructor(material, layer) {
143
- super(material, layer);
141
+ constructor(layer) {
142
+ super(layer);
144
143
  const defaultEle = {
145
144
  bias: 0,
146
145
  mode: ELEVATION_MODES.DATA,
@@ -0,0 +1,11 @@
1
+ declare namespace _default {
2
+ export { MODES };
3
+ export { push };
4
+ }
5
+ export default _default;
6
+ declare namespace MODES {
7
+ let FINAL: number;
8
+ let DEPTH: number;
9
+ let ID: number;
10
+ }
11
+ declare function push(object3d: any, mode: any): () => void;
@@ -14,6 +14,7 @@ function push(object3d, mode) {
14
14
  const material = node.material;
15
15
  if (material) {
16
16
  material.mode = m;
17
+ material.transparent = m === MODES.FINAL;
17
18
  }
18
19
  };
19
20
  object3d.traverse(setMode(mode));
@@ -0,0 +1,78 @@
1
+ export default ShaderChunk;
2
+ declare const ShaderChunk: ShaderChunkManager;
3
+ /**
4
+ * The ShaderChunkManager manages the itowns chunks shader.
5
+ * It adds chunks to THREE.ShaderChunk to compile shaders
6
+ *
7
+ * In itowns, if you want access to `ShaderChunkManager` instance :
8
+ *
9
+ * ```js
10
+ * import ShaderChunk from '../../Renderer/Shader/ShaderChunk';
11
+ * ```
12
+ * or
13
+ * ```js
14
+ * const ShaderChunk = itowns.ShaderChunk';
15
+ * ```
16
+ *
17
+ * @property {Object} target - The target to install the chunks into.
18
+ * @property {string} [path] - A path to add before a chunk name as a prefix.
19
+ *
20
+ */
21
+ declare class ShaderChunkManager {
22
+ /**
23
+ * Constructs a new instance ShaderChunkManager.
24
+ *
25
+ * @constructor
26
+ *
27
+ * @param {Object} target - The target to install the chunks into.
28
+ * @param {string} [path] - A path to add before a chunk name as a prefix.
29
+ *
30
+ */
31
+ constructor(target: Object, path?: string);
32
+ path: string | undefined;
33
+ target: Object;
34
+ /**
35
+ * Set the header ColorLayer shader.
36
+ *
37
+ * @param {string} header The glsl header
38
+ */
39
+ customHeaderColorLayer(header: string): void;
40
+ /**
41
+ * Set the body ColorLayer shader.
42
+ * You could define you color terrain shader, with a header and a body.
43
+ * the header defines yours fonctions and the body defines the process on ColorLayer.
44
+ * @example <caption>Custom shader chunk</caption>
45
+ * itowns.ShaderChunk.customHeaderColorLayer(`
46
+ * // define yours methods
47
+ * vec4 myColor(vec4 color, float a) {
48
+ * return color * a;
49
+ * }
50
+ * `);
51
+ * itowns.ShaderChunk.customBodyColorLayer(`
52
+ * // the body set final color layer.
53
+ * // layer.amount_effect is variable, it could be change in Layer instance.
54
+ * color = myColor(color, layer.amount_effect)
55
+ * `);
56
+ *
57
+ * var colorLayer = new itowns.ColorLayer('OPENSM', {
58
+ * source,
59
+ * type_effect: itowns.colorLayerEffects.customEffect,
60
+ * amount_effect: 0.5,
61
+ * });
62
+ *
63
+ * @param {string} body The glsl body
64
+ */
65
+ customBodyColorLayer(body: string): void;
66
+ /**
67
+ * Install chunks in a target, for example THREE.ShaderChunk, with adding an
68
+ * optional path.
69
+ *
70
+ * @param {Object} target - The target to install the chunks into.
71
+ * @param {Object} chunks - The chunks to install. The key of each chunk will be
72
+ * the name of installation of the chunk in the target (plus an optional path).
73
+ * @param {string} [path] - A path to add before a chunk name as a prefix.
74
+ *
75
+ * @return {Object} The target with installed chunks.
76
+ */
77
+ install(target?: Object, chunks?: Object, path?: string): Object;
78
+ }
@@ -0,0 +1,5 @@
1
+ declare namespace _default {
2
+ function patchMaterialForLogDepthSupport(material: any): void;
3
+ function unrollLoops(string: any, defines: any): any;
4
+ }
5
+ export default _default;
@@ -0,0 +1,33 @@
1
+ export namespace VR_EVENTS {
2
+ let CONTROLS_INITIALIZED: string;
3
+ }
4
+ export default WebXR;
5
+ /**
6
+ * @property {VRControls} vrControls - WebXR controllers handler
7
+ * */
8
+ declare class WebXR extends THREE.EventDispatcher<any> {
9
+ /**
10
+ * Handler of a webXR session
11
+ *
12
+ *
13
+ * @param {GlobeView} view - The view where the webXR session will be started
14
+ * @param {Object} [options] - WebXR configuration - its presence alone
15
+ * enable WebXR to switch on VR visualization.
16
+ * @param {function} [options.callback] - WebXR rendering callback (optional).
17
+ * @param {boolean} [options.controllers] - Enable the webXR controllers handling (optional).
18
+ */
19
+ constructor(view: GlobeView, options?: {
20
+ callback?: Function | undefined;
21
+ controllers?: boolean | undefined;
22
+ });
23
+ view: GlobeView;
24
+ options: {
25
+ callback?: Function | undefined;
26
+ controllers?: boolean | undefined;
27
+ } | undefined;
28
+ renderCb: Function | undefined;
29
+ vrControls: VRControls | null;
30
+ initializeWebXR: () => void;
31
+ }
32
+ import * as THREE from 'three';
33
+ import VRControls from '../Controls/VRControls';