@deck.gl/geo-layers 9.0.35 → 9.1.0-beta.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.
- package/dist/dist.dev.js +23221 -6550
- package/dist/geo-cell-layer/GeoCellLayer.d.ts.map +1 -1
- package/dist/geo-cell-layer/GeoCellLayer.js +3 -0
- package/dist/geohash-layer/geohash-layer.d.ts.map +1 -1
- package/dist/geohash-layer/geohash-layer.js +3 -0
- package/dist/geohash-layer/geohash-utils.d.ts.map +1 -1
- package/dist/geohash-layer/geohash-utils.js +3 -0
- package/dist/great-circle-layer/great-circle-layer.d.ts.map +1 -1
- package/dist/great-circle-layer/great-circle-layer.js +3 -0
- package/dist/h3-layers/h3-cluster-layer.d.ts.map +1 -1
- package/dist/h3-layers/h3-cluster-layer.js +3 -0
- package/dist/h3-layers/h3-hexagon-layer.d.ts.map +1 -1
- package/dist/h3-layers/h3-hexagon-layer.js +3 -0
- package/dist/h3-layers/h3-utils.d.ts.map +1 -1
- package/dist/h3-layers/h3-utils.js +3 -0
- package/dist/index.cjs +173 -48
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -19
- package/dist/mesh-layer/mesh-layer-fragment.glsl.d.ts +1 -1
- package/dist/mesh-layer/mesh-layer-fragment.glsl.d.ts.map +1 -1
- package/dist/mesh-layer/mesh-layer-fragment.glsl.js +8 -8
- package/dist/mesh-layer/mesh-layer-uniforms.d.ts +12 -0
- package/dist/mesh-layer/mesh-layer-uniforms.d.ts.map +1 -0
- package/dist/mesh-layer/mesh-layer-uniforms.js +16 -0
- package/dist/mesh-layer/mesh-layer-vertex.glsl.d.ts +1 -1
- package/dist/mesh-layer/mesh-layer-vertex.glsl.d.ts.map +1 -1
- package/dist/mesh-layer/mesh-layer-vertex.glsl.js +7 -7
- package/dist/mesh-layer/mesh-layer.d.ts +2 -2
- package/dist/mesh-layer/mesh-layer.d.ts.map +1 -1
- package/dist/mesh-layer/mesh-layer.js +35 -16
- package/dist/mvt-layer/coordinate-transform.d.ts.map +1 -1
- package/dist/mvt-layer/coordinate-transform.js +3 -0
- package/dist/mvt-layer/find-index-binary.d.ts.map +1 -1
- package/dist/mvt-layer/find-index-binary.js +3 -0
- package/dist/mvt-layer/mvt-layer.d.ts.map +1 -1
- package/dist/mvt-layer/mvt-layer.js +3 -0
- package/dist/quadkey-layer/quadkey-layer.d.ts.map +1 -1
- package/dist/quadkey-layer/quadkey-layer.js +3 -0
- package/dist/quadkey-layer/quadkey-utils.d.ts.map +1 -1
- package/dist/quadkey-layer/quadkey-utils.js +3 -0
- package/dist/s2-layer/s2-geometry.d.ts.map +1 -1
- package/dist/s2-layer/s2-geometry.js +3 -0
- package/dist/s2-layer/s2-layer.d.ts.map +1 -1
- package/dist/s2-layer/s2-layer.js +3 -19
- package/dist/s2-layer/s2-utils.d.ts.map +1 -1
- package/dist/s2-layer/s2-utils.js +3 -0
- package/dist/terrain-layer/terrain-layer.d.ts.map +1 -1
- package/dist/terrain-layer/terrain-layer.js +3 -19
- package/dist/tile-3d-layer/tile-3d-layer.d.ts +6 -6
- package/dist/tile-3d-layer/tile-3d-layer.d.ts.map +1 -1
- package/dist/tile-3d-layer/tile-3d-layer.js +3 -0
- package/dist/tile-layer/tile-layer.d.ts.map +1 -1
- package/dist/tile-layer/tile-layer.js +3 -0
- package/dist/tileset-2d/index.d.ts.map +1 -1
- package/dist/tileset-2d/index.js +3 -1
- package/dist/tileset-2d/memoize.d.ts.map +1 -1
- package/dist/tileset-2d/memoize.js +3 -0
- package/dist/tileset-2d/tile-2d-header.d.ts.map +1 -1
- package/dist/tileset-2d/tile-2d-header.js +3 -0
- package/dist/tileset-2d/tile-2d-traversal.d.ts.map +1 -1
- package/dist/tileset-2d/tile-2d-traversal.js +3 -0
- package/dist/tileset-2d/tileset-2d.d.ts.map +1 -1
- package/dist/tileset-2d/tileset-2d.js +3 -0
- package/dist/tileset-2d/types.d.ts.map +1 -1
- package/dist/tileset-2d/types.js +3 -0
- package/dist/tileset-2d/utils.d.ts.map +1 -1
- package/dist/tileset-2d/utils.js +3 -0
- package/dist/trips-layer/trips-layer-uniforms.d.ts +16 -0
- package/dist/trips-layer/trips-layer-uniforms.d.ts.map +1 -0
- package/dist/trips-layer/trips-layer-uniforms.js +20 -0
- package/dist/trips-layer/trips-layer.d.ts.map +1 -1
- package/dist/trips-layer/trips-layer.js +11 -32
- package/dist/wms-layer/utils.d.ts.map +1 -1
- package/dist/wms-layer/utils.js +3 -0
- package/dist/wms-layer/wms-layer.d.ts.map +1 -1
- package/dist/wms-layer/wms-layer.js +3 -0
- package/dist.min.js +530 -260
- package/package.json +13 -13
- package/src/geo-cell-layer/GeoCellLayer.ts +4 -0
- package/src/geohash-layer/geohash-layer.ts +4 -0
- package/src/geohash-layer/geohash-utils.ts +4 -0
- package/src/great-circle-layer/great-circle-layer.ts +4 -19
- package/src/h3-layers/h3-cluster-layer.ts +4 -0
- package/src/h3-layers/h3-hexagon-layer.ts +4 -0
- package/src/h3-layers/h3-utils.ts +4 -0
- package/src/index.ts +4 -19
- package/src/mesh-layer/mesh-layer-fragment.glsl.ts +9 -8
- package/src/mesh-layer/mesh-layer-uniforms.ts +24 -0
- package/src/mesh-layer/mesh-layer-vertex.glsl.ts +8 -9
- package/src/mesh-layer/mesh-layer.ts +37 -16
- package/src/mvt-layer/coordinate-transform.ts +4 -0
- package/src/mvt-layer/find-index-binary.ts +4 -0
- package/src/mvt-layer/mvt-layer.ts +4 -0
- package/src/quadkey-layer/quadkey-layer.ts +4 -0
- package/src/quadkey-layer/quadkey-utils.ts +4 -0
- package/src/s2-layer/s2-geometry.ts +4 -0
- package/src/s2-layer/s2-layer.ts +3 -19
- package/src/s2-layer/s2-utils.ts +4 -0
- package/src/terrain-layer/terrain-layer.ts +3 -19
- package/src/tile-3d-layer/tile-3d-layer.ts +4 -0
- package/src/tile-layer/tile-layer.ts +4 -0
- package/src/tileset-2d/index.ts +4 -0
- package/src/tileset-2d/memoize.ts +4 -0
- package/src/tileset-2d/tile-2d-header.ts +4 -0
- package/src/tileset-2d/tile-2d-traversal.ts +4 -0
- package/src/tileset-2d/tileset-2d.ts +4 -0
- package/src/tileset-2d/types.ts +4 -0
- package/src/tileset-2d/utils.ts +4 -0
- package/src/trips-layer/trips-layer-uniforms.ts +30 -0
- package/src/trips-layer/trips-layer.ts +12 -33
- package/src/wms-layer/utils.ts +4 -0
- package/src/wms-layer/wms-layer.ts +4 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "deck.gl layers supporting geospatial use cases and GIS formats",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "9.0.
|
|
6
|
+
"version": "9.1.0-beta.1",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -46,23 +46,23 @@
|
|
|
46
46
|
"@loaders.gl/terrain": "^4.2.0",
|
|
47
47
|
"@loaders.gl/tiles": "^4.2.0",
|
|
48
48
|
"@loaders.gl/wms": "^4.2.0",
|
|
49
|
-
"@luma.gl/gltf": "
|
|
50
|
-
"@luma.gl/shadertools": "
|
|
51
|
-
"@math.gl/core": "^4.
|
|
52
|
-
"@math.gl/culling": "^4.
|
|
53
|
-
"@math.gl/web-mercator": "^4.
|
|
49
|
+
"@luma.gl/gltf": "^9.1.0-beta.11",
|
|
50
|
+
"@luma.gl/shadertools": "^9.1.0-beta.11",
|
|
51
|
+
"@math.gl/core": "^4.1.0",
|
|
52
|
+
"@math.gl/culling": "^4.1.0",
|
|
53
|
+
"@math.gl/web-mercator": "^4.1.0",
|
|
54
54
|
"@types/geojson": "^7946.0.8",
|
|
55
55
|
"h3-js": "^4.1.0",
|
|
56
56
|
"long": "^3.2.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@deck.gl/core": "
|
|
60
|
-
"@deck.gl/extensions": "
|
|
61
|
-
"@deck.gl/layers": "
|
|
62
|
-
"@deck.gl/mesh-layers": "
|
|
59
|
+
"@deck.gl/core": "9.0.0-alpha.0",
|
|
60
|
+
"@deck.gl/extensions": "9.0.0-alpha.0",
|
|
61
|
+
"@deck.gl/layers": "9.0.0-alpha.0",
|
|
62
|
+
"@deck.gl/mesh-layers": "9.0.0-alpha.0",
|
|
63
63
|
"@loaders.gl/core": "^4.2.0",
|
|
64
|
-
"@luma.gl/core": "
|
|
65
|
-
"@luma.gl/engine": "
|
|
64
|
+
"@luma.gl/core": "^9.1.0-beta.11",
|
|
65
|
+
"@luma.gl/engine": "^9.1.0-beta.11"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a86fb154cf323eacc3f56ef087f636fb9f6c30b6"
|
|
68
68
|
}
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// in the Software without restriction, including without limitation the rights
|
|
6
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
// furnished to do so, subject to the following conditions:
|
|
9
|
-
//
|
|
10
|
-
// The above copyright notice and this permission notice shall be included in
|
|
11
|
-
// all copies or substantial portions of the Software.
|
|
12
|
-
//
|
|
13
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
// THE SOFTWARE.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
20
5
|
import {DefaultProps} from '@deck.gl/core';
|
|
21
6
|
import {ArcLayer, ArcLayerProps} from '@deck.gl/layers';
|
|
22
7
|
|
package/src/index.ts
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// in the Software without restriction, including without limitation the rights
|
|
6
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
// furnished to do so, subject to the following conditions:
|
|
9
|
-
//
|
|
10
|
-
// The above copyright notice and this permission notice shall be included in
|
|
11
|
-
// all copies or substantial portions of the Software.
|
|
12
|
-
//
|
|
13
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
// THE SOFTWARE.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
20
5
|
/* eslint-disable max-len */
|
|
21
6
|
|
|
22
7
|
export {WMSLayer as _WMSLayer} from './wms-layer/wms-layer';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
export default `#version 300 es
|
|
2
6
|
#define SHADER_NAME simple-mesh-layer-fs
|
|
3
7
|
|
|
4
8
|
precision highp float;
|
|
5
9
|
|
|
6
|
-
uniform bool hasTexture;
|
|
7
10
|
uniform sampler2D sampler;
|
|
8
|
-
uniform bool flatShading;
|
|
9
|
-
uniform float opacity;
|
|
10
11
|
|
|
11
12
|
in vec2 vTexCoord;
|
|
12
13
|
in vec3 cameraPosition;
|
|
@@ -18,27 +19,27 @@ out vec4 fragColor;
|
|
|
18
19
|
|
|
19
20
|
void main(void) {
|
|
20
21
|
|
|
21
|
-
#ifdef
|
|
22
|
+
#ifdef MODULE_PBRMATERIAL
|
|
22
23
|
|
|
23
24
|
fragColor = vColor * pbr_filterColor(vec4(0));
|
|
24
25
|
geometry.uv = pbr_vUV;
|
|
25
|
-
fragColor.a *= opacity;
|
|
26
|
+
fragColor.a *= layer.opacity;
|
|
26
27
|
|
|
27
28
|
#else
|
|
28
29
|
|
|
29
30
|
geometry.uv = vTexCoord;
|
|
30
31
|
|
|
31
32
|
vec3 normal;
|
|
32
|
-
if (flatShading) {
|
|
33
|
+
if (simpleMesh.flatShading) {
|
|
33
34
|
|
|
34
35
|
normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
|
|
35
36
|
} else {
|
|
36
37
|
normal = normals_commonspace;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
|
|
40
|
+
vec4 color = simpleMesh.hasTexture ? texture(sampler, vTexCoord) : vColor;
|
|
40
41
|
vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
|
|
41
|
-
fragColor = vec4(lightColor, color.a * opacity);
|
|
42
|
+
fragColor = vec4(lightColor, color.a * layer.opacity);
|
|
42
43
|
|
|
43
44
|
#endif
|
|
44
45
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {ShaderModule} from '@luma.gl/shadertools';
|
|
6
|
+
|
|
7
|
+
const uniformBlock = `\
|
|
8
|
+
uniform meshUniforms {
|
|
9
|
+
bool pickFeatureIds;
|
|
10
|
+
} mesh;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export type MeshProps = {
|
|
14
|
+
pickFeatureIds: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const meshUniforms = {
|
|
18
|
+
name: 'mesh',
|
|
19
|
+
vs: uniformBlock,
|
|
20
|
+
fs: uniformBlock,
|
|
21
|
+
uniformTypes: {
|
|
22
|
+
pickFeatureIds: 'f32'
|
|
23
|
+
}
|
|
24
|
+
} as const satisfies ShaderModule<MeshProps>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
export default `#version 300 es
|
|
2
6
|
#define SHADER_NAME simple-mesh-layer-vs
|
|
3
7
|
|
|
4
|
-
// Scale the model
|
|
5
|
-
uniform float sizeScale;
|
|
6
|
-
uniform bool composeModelMatrix;
|
|
7
|
-
uniform bool pickFeatureIds;
|
|
8
|
-
|
|
9
8
|
// Primitive attributes
|
|
10
9
|
in vec3 positions;
|
|
11
10
|
in vec3 normals;
|
|
@@ -41,7 +40,7 @@ void main(void) {
|
|
|
41
40
|
vec2 uv = applyUVRegion(texCoords);
|
|
42
41
|
geometry.uv = uv;
|
|
43
42
|
|
|
44
|
-
if (pickFeatureIds) {
|
|
43
|
+
if (mesh.pickFeatureIds) {
|
|
45
44
|
geometry.pickingColor = featureIdsPickingColors;
|
|
46
45
|
} else {
|
|
47
46
|
geometry.pickingColor = instancePickingColors;
|
|
@@ -50,10 +49,10 @@ void main(void) {
|
|
|
50
49
|
mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);
|
|
51
50
|
|
|
52
51
|
vTexCoord = uv;
|
|
53
|
-
cameraPosition =
|
|
52
|
+
cameraPosition = project.cameraPosition;
|
|
54
53
|
vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
|
|
55
54
|
|
|
56
|
-
vec3 pos = (instanceModelMatrix * positions) * sizeScale;
|
|
55
|
+
vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale;
|
|
57
56
|
vec3 projectedPosition = project_position(positions);
|
|
58
57
|
position_commonspace = vec4(projectedPosition, 1.0);
|
|
59
58
|
gl_Position = project_common_position_to_clipspace(position_commonspace);
|
|
@@ -64,7 +63,7 @@ void main(void) {
|
|
|
64
63
|
|
|
65
64
|
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
66
65
|
|
|
67
|
-
#ifdef
|
|
66
|
+
#ifdef MODULE_PBRMATERIAL
|
|
68
67
|
// set PBR data
|
|
69
68
|
pbr_vPosition = geometry.position.xyz;
|
|
70
69
|
#ifdef HAS_NORMALS
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
import type {NumericArray} from '@math.gl/core';
|
|
2
6
|
import {parsePBRMaterial, ParsedPBRMaterial} from '@luma.gl/gltf';
|
|
3
|
-
import {
|
|
7
|
+
import {pbrMaterial} from '@luma.gl/shadertools';
|
|
4
8
|
import {Model} from '@luma.gl/engine';
|
|
5
9
|
import type {MeshAttribute, MeshAttributes} from '@loaders.gl/schema';
|
|
6
10
|
import type {UpdateParameters, DefaultProps, LayerContext} from '@deck.gl/core';
|
|
7
11
|
import {SimpleMeshLayer, SimpleMeshLayerProps} from '@deck.gl/mesh-layers';
|
|
8
12
|
|
|
13
|
+
import {MeshProps, meshUniforms} from './mesh-layer-uniforms';
|
|
9
14
|
import vs from './mesh-layer-vertex.glsl';
|
|
10
15
|
import fs from './mesh-layer-fragment.glsl';
|
|
11
16
|
|
|
@@ -58,7 +63,7 @@ export default class MeshLayer<DataT = any, ExtraProps extends {} = {}> extends
|
|
|
58
63
|
getShaders() {
|
|
59
64
|
const shaders = super.getShaders();
|
|
60
65
|
const modules = shaders.modules;
|
|
61
|
-
modules.push(
|
|
66
|
+
modules.push(pbrMaterial, meshUniforms);
|
|
62
67
|
return {...shaders, vs, fs};
|
|
63
68
|
}
|
|
64
69
|
|
|
@@ -92,22 +97,28 @@ export default class MeshLayer<DataT = any, ExtraProps extends {} = {}> extends
|
|
|
92
97
|
|
|
93
98
|
draw(opts) {
|
|
94
99
|
const {featureIds} = this.props;
|
|
95
|
-
|
|
100
|
+
const {model} = this.state;
|
|
101
|
+
if (!model) {
|
|
96
102
|
return;
|
|
97
103
|
}
|
|
98
|
-
|
|
99
|
-
// Needed for PBR (TODO: find better way to get it)
|
|
100
|
-
// eslint-disable-next-line camelcase
|
|
101
|
-
u_Camera: this.state.model.uniforms.project_uCameraPosition,
|
|
104
|
+
const meshProps: MeshProps = {
|
|
102
105
|
pickFeatureIds: Boolean(featureIds)
|
|
106
|
+
};
|
|
107
|
+
const pbrProjectionProps = {
|
|
108
|
+
// Needed for PBR (TODO: find better way to get it)
|
|
109
|
+
camera: model.uniforms.cameraPosition as [number, number, number]
|
|
110
|
+
};
|
|
111
|
+
model.shaderInputs.setProps({
|
|
112
|
+
pbrProjection: pbrProjectionProps,
|
|
113
|
+
mesh: meshProps
|
|
103
114
|
});
|
|
104
115
|
|
|
105
116
|
super.draw(opts);
|
|
106
117
|
}
|
|
107
118
|
|
|
108
119
|
protected getModel(mesh: Mesh): Model {
|
|
109
|
-
const {id
|
|
110
|
-
const parsedPBRMaterial = this.parseMaterial(pbrMaterial, mesh);
|
|
120
|
+
const {id} = this.props;
|
|
121
|
+
const parsedPBRMaterial = this.parseMaterial(this.props.pbrMaterial, mesh);
|
|
111
122
|
// Keep material to explicitly remove textures
|
|
112
123
|
this.setState({parsedPBRMaterial});
|
|
113
124
|
const shaders = this.getShaders();
|
|
@@ -129,26 +140,36 @@ export default class MeshLayer<DataT = any, ExtraProps extends {} = {}> extends
|
|
|
129
140
|
return model;
|
|
130
141
|
}
|
|
131
142
|
|
|
132
|
-
updatePbrMaterialUniforms(
|
|
143
|
+
updatePbrMaterialUniforms(material) {
|
|
133
144
|
const {model} = this.state;
|
|
134
145
|
if (model) {
|
|
135
146
|
const {mesh} = this.props;
|
|
136
|
-
const parsedPBRMaterial = this.parseMaterial(
|
|
147
|
+
const parsedPBRMaterial = this.parseMaterial(material, mesh as Mesh);
|
|
137
148
|
// Keep material to explicitly remove textures
|
|
138
149
|
this.setState({parsedPBRMaterial});
|
|
139
|
-
|
|
140
|
-
|
|
150
|
+
|
|
151
|
+
const {pbr_baseColorSampler} = parsedPBRMaterial.bindings;
|
|
152
|
+
const {emptyTexture} = this.state;
|
|
153
|
+
const simpleMeshProps = {
|
|
154
|
+
sampler: pbr_baseColorSampler || emptyTexture,
|
|
155
|
+
hasTexture: Boolean(pbr_baseColorSampler)
|
|
156
|
+
};
|
|
157
|
+
const {camera, ...pbrMaterialProps} = {
|
|
158
|
+
...parsedPBRMaterial.bindings,
|
|
159
|
+
...parsedPBRMaterial.uniforms
|
|
160
|
+
};
|
|
161
|
+
model.shaderInputs.setProps({simpleMesh: simpleMeshProps, pbrMaterial: pbrMaterialProps});
|
|
141
162
|
}
|
|
142
163
|
}
|
|
143
164
|
|
|
144
|
-
parseMaterial(
|
|
165
|
+
parseMaterial(material, mesh: Mesh): ParsedPBRMaterial {
|
|
145
166
|
const unlit = Boolean(
|
|
146
|
-
|
|
167
|
+
material.pbrMetallicRoughness && material.pbrMetallicRoughness.baseColorTexture
|
|
147
168
|
);
|
|
148
169
|
|
|
149
170
|
return parsePBRMaterial(
|
|
150
171
|
this.context.device,
|
|
151
|
-
{unlit, ...
|
|
172
|
+
{unlit, ...material},
|
|
152
173
|
{NORMAL: mesh.attributes.normals, TEXCOORD_0: mesh.attributes.texCoords},
|
|
153
174
|
{
|
|
154
175
|
pbrDebug: false,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
1
5
|
import {AccessorFunction, DefaultProps} from '@deck.gl/core';
|
|
2
6
|
import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer';
|
|
3
7
|
import {getQuadkeyPolygon} from './quadkey-utils';
|
package/src/s2-layer/s2-layer.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
// in the Software without restriction, including without limitation the rights
|
|
6
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
// furnished to do so, subject to the following conditions:
|
|
9
|
-
//
|
|
10
|
-
// The above copyright notice and this permission notice shall be included in
|
|
11
|
-
// all copies or substantial portions of the Software.
|
|
12
|
-
//
|
|
13
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
// THE SOFTWARE.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
20
4
|
|
|
21
5
|
import {AccessorFunction, DefaultProps} from '@deck.gl/core';
|
|
22
6
|
import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer';
|
package/src/s2-layer/s2-utils.ts
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
// in the Software without restriction, including without limitation the rights
|
|
6
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
// furnished to do so, subject to the following conditions:
|
|
9
|
-
//
|
|
10
|
-
// The above copyright notice and this permission notice shall be included in
|
|
11
|
-
// all copies or substantial portions of the Software.
|
|
12
|
-
//
|
|
13
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
// THE SOFTWARE.
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
20
4
|
|
|
21
5
|
import {
|
|
22
6
|
Color,
|
package/src/tileset-2d/index.ts
CHANGED
package/src/tileset-2d/types.ts
CHANGED
package/src/tileset-2d/utils.ts
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// deck.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {ShaderModule} from '@luma.gl/shadertools';
|
|
6
|
+
|
|
7
|
+
const uniformBlock = `\
|
|
8
|
+
uniform tripsUniforms {
|
|
9
|
+
bool fadeTrail;
|
|
10
|
+
float trailLength;
|
|
11
|
+
float currentTime;
|
|
12
|
+
} trips;
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export type TripsProps = {
|
|
16
|
+
fadeTrail: boolean;
|
|
17
|
+
trailLength: number;
|
|
18
|
+
currentTime: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const tripsUniforms = {
|
|
22
|
+
name: 'trips',
|
|
23
|
+
vs: uniformBlock,
|
|
24
|
+
fs: uniformBlock,
|
|
25
|
+
uniformTypes: {
|
|
26
|
+
fadeTrail: 'f32',
|
|
27
|
+
trailLength: 'f32',
|
|
28
|
+
currentTime: 'f32'
|
|
29
|
+
}
|
|
30
|
+
} as const satisfies ShaderModule<TripsProps>;
|