@deck.gl/extensions 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.
Files changed (128) hide show
  1. package/dist/brushing/brushing-extension.d.ts +1 -0
  2. package/dist/brushing/brushing-extension.d.ts.map +1 -1
  3. package/dist/brushing/brushing-extension.js +15 -19
  4. package/dist/brushing/shader-module.d.ts +8 -2
  5. package/dist/brushing/shader-module.d.ts.map +1 -1
  6. package/dist/brushing/shader-module.js +74 -50
  7. package/dist/clip/clip-extension.d.ts +5 -2
  8. package/dist/clip/clip-extension.d.ts.map +1 -1
  9. package/dist/clip/clip-extension.js +36 -42
  10. package/dist/collision-filter/collision-filter-effect.d.ts +4 -4
  11. package/dist/collision-filter/collision-filter-effect.d.ts.map +1 -1
  12. package/dist/collision-filter/collision-filter-effect.js +27 -13
  13. package/dist/collision-filter/collision-filter-extension.d.ts +1 -1
  14. package/dist/collision-filter/collision-filter-extension.d.ts.map +1 -1
  15. package/dist/collision-filter/collision-filter-extension.js +5 -6
  16. package/dist/collision-filter/collision-filter-pass.d.ts +7 -3
  17. package/dist/collision-filter/collision-filter-pass.d.ts.map +1 -1
  18. package/dist/collision-filter/collision-filter-pass.js +8 -3
  19. package/dist/collision-filter/shader-module.d.ts +3 -2
  20. package/dist/collision-filter/shader-module.d.ts.map +1 -1
  21. package/dist/collision-filter/shader-module.js +74 -52
  22. package/dist/data-filter/aggregator.d.ts +4 -10
  23. package/dist/data-filter/aggregator.d.ts.map +1 -1
  24. package/dist/data-filter/aggregator.js +14 -8
  25. package/dist/data-filter/data-filter-extension.d.ts.map +1 -1
  26. package/dist/data-filter/data-filter-extension.js +40 -38
  27. package/dist/data-filter/shader-module.d.ts +11 -4
  28. package/dist/data-filter/shader-module.d.ts.map +1 -1
  29. package/dist/data-filter/shader-module.js +189 -131
  30. package/dist/dist.dev.js +2699 -2028
  31. package/dist/fill-style/fill-style-extension.d.ts.map +1 -1
  32. package/dist/fill-style/fill-style-extension.js +11 -4
  33. package/dist/fill-style/shader-module.d.ts +64 -6
  34. package/dist/fill-style/shader-module.d.ts.map +1 -1
  35. package/dist/fill-style/shader-module.js +73 -51
  36. package/dist/fp64/fp64-extension.d.ts +1 -0
  37. package/dist/fp64/fp64-extension.d.ts.map +1 -1
  38. package/dist/fp64/fp64-extension.js +7 -19
  39. package/dist/fp64/project64.d.ts +2 -2
  40. package/dist/fp64/project64.d.ts.map +1 -1
  41. package/dist/fp64/project64.glsl.d.ts +1 -1
  42. package/dist/fp64/project64.glsl.d.ts.map +1 -1
  43. package/dist/fp64/project64.glsl.js +18 -21
  44. package/dist/fp64/project64.js +24 -24
  45. package/dist/index.cjs +1017 -523
  46. package/dist/index.cjs.map +3 -3
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +3 -0
  50. package/dist/mask/mask-effect.d.ts +5 -3
  51. package/dist/mask/mask-effect.d.ts.map +1 -1
  52. package/dist/mask/mask-effect.js +12 -5
  53. package/dist/mask/mask-extension.d.ts +1 -1
  54. package/dist/mask/mask-extension.d.ts.map +1 -1
  55. package/dist/mask/mask-extension.js +13 -8
  56. package/dist/mask/mask-pass.d.ts +38 -38
  57. package/dist/mask/mask-pass.d.ts.map +1 -1
  58. package/dist/mask/mask-pass.js +3 -0
  59. package/dist/mask/shader-module.d.ts +60 -3
  60. package/dist/mask/shader-module.d.ts.map +1 -1
  61. package/dist/mask/shader-module.js +73 -46
  62. package/dist/path-style/path-style-extension.d.ts.map +1 -1
  63. package/dist/path-style/path-style-extension.js +20 -24
  64. package/dist/path-style/shaders.glsl.d.ts.map +1 -1
  65. package/dist/path-style/shaders.glsl.js +11 -7
  66. package/dist/terrain/height-map-builder.d.ts.map +1 -1
  67. package/dist/terrain/height-map-builder.js +3 -0
  68. package/dist/terrain/shader-module.d.ts +60 -6
  69. package/dist/terrain/shader-module.d.ts.map +1 -1
  70. package/dist/terrain/shader-module.js +69 -61
  71. package/dist/terrain/terrain-cover.d.ts.map +1 -1
  72. package/dist/terrain/terrain-cover.js +3 -0
  73. package/dist/terrain/terrain-effect.d.ts +4 -2
  74. package/dist/terrain/terrain-effect.d.ts.map +1 -1
  75. package/dist/terrain/terrain-effect.js +31 -18
  76. package/dist/terrain/terrain-extension.d.ts.map +1 -1
  77. package/dist/terrain/terrain-extension.js +3 -0
  78. package/dist/terrain/terrain-pass.d.ts +43 -38
  79. package/dist/terrain/terrain-pass.d.ts.map +1 -1
  80. package/dist/terrain/terrain-pass.js +10 -0
  81. package/dist/terrain/terrain-picking-pass.d.ts +5 -0
  82. package/dist/terrain/terrain-picking-pass.d.ts.map +1 -1
  83. package/dist/terrain/terrain-picking-pass.js +10 -0
  84. package/dist/terrain/utils.d.ts.map +1 -1
  85. package/dist/terrain/utils.js +3 -0
  86. package/dist/utils/debug.d.ts +2 -2
  87. package/dist/utils/debug.d.ts.map +1 -1
  88. package/dist/utils/debug.js +3 -1
  89. package/dist/utils/projection-utils.d.ts.map +1 -1
  90. package/dist/utils/projection-utils.js +3 -0
  91. package/dist.min.js +1102 -817
  92. package/package.json +8 -8
  93. package/src/brushing/brushing-extension.ts +17 -20
  94. package/src/brushing/shader-module.ts +58 -47
  95. package/src/clip/clip-extension.ts +38 -40
  96. package/src/collision-filter/collision-filter-effect.ts +31 -20
  97. package/src/collision-filter/collision-filter-extension.ts +6 -7
  98. package/src/collision-filter/collision-filter-pass.ts +9 -3
  99. package/src/collision-filter/shader-module.ts +40 -22
  100. package/src/data-filter/aggregator.ts +23 -11
  101. package/src/data-filter/data-filter-extension.ts +68 -48
  102. package/src/data-filter/shader-module.ts +144 -84
  103. package/src/fill-style/fill-style-extension.ts +13 -5
  104. package/src/fill-style/shader-module.ts +84 -52
  105. package/src/fp64/fp64-extension.ts +8 -19
  106. package/src/fp64/project64.glsl.ts +18 -21
  107. package/src/fp64/project64.ts +27 -28
  108. package/src/index.ts +5 -0
  109. package/src/mask/mask-effect.ts +17 -7
  110. package/src/mask/mask-extension.ts +16 -9
  111. package/src/mask/mask-pass.ts +4 -0
  112. package/src/mask/shader-module.ts +63 -27
  113. package/src/path-style/path-style-extension.ts +27 -28
  114. package/src/path-style/shaders.glsl.ts +13 -7
  115. package/src/terrain/height-map-builder.ts +4 -0
  116. package/src/terrain/shader-module.ts +62 -44
  117. package/src/terrain/terrain-cover.ts +4 -0
  118. package/src/terrain/terrain-effect.ts +36 -19
  119. package/src/terrain/terrain-extension.ts +4 -0
  120. package/src/terrain/terrain-pass.ts +12 -0
  121. package/src/terrain/terrain-picking-pass.ts +12 -0
  122. package/src/terrain/utils.ts +4 -0
  123. package/src/utils/debug.ts +4 -0
  124. package/src/utils/projection-utils.ts +4 -0
  125. package/dist/utils/syntax-tags.d.ts +0 -6
  126. package/dist/utils/syntax-tags.d.ts.map +0 -1
  127. package/dist/utils/syntax-tags.js +0 -5
  128. package/src/utils/syntax-tags.ts +0 -5
@@ -1,12 +1,11 @@
1
- import type { ShaderModule } from '@luma.gl/shadertools';
1
+ import { ProjectProps } from '@deck.gl/core';
2
2
  import type { Texture } from '@luma.gl/core';
3
3
  import type { Bounds } from "../utils/projection-utils.js";
4
4
  import type { TerrainCover } from "./terrain-cover.js";
5
5
  /** Module parameters expected by the terrain shader module */
6
- export type TerrainModuleSettings = {
7
- picking: {
8
- isActive?: boolean;
9
- };
6
+ export type TerrainModuleProps = {
7
+ project: ProjectProps;
8
+ isPicking: boolean;
10
9
  heightMap: Texture | null;
11
10
  heightMapBounds?: Bounds | null;
12
11
  dummyHeightMap: Texture;
@@ -29,5 +28,60 @@ export declare const TERRAIN_MODE: {
29
28
  /** Draped layer is rendered into a texture, and never to screen */
30
29
  SKIP: number;
31
30
  };
32
- export declare const terrainModule: ShaderModule<TerrainModuleSettings>;
31
+ export declare const terrainModule: {
32
+ readonly name: "terrain";
33
+ readonly dependencies: [{
34
+ readonly name: "project";
35
+ readonly dependencies: [{
36
+ name: string;
37
+ vs: string;
38
+ }, {
39
+ readonly name: "geometry";
40
+ readonly vs: "\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n";
41
+ readonly fs: "\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n";
42
+ }];
43
+ readonly vs: string;
44
+ readonly getUniforms: (opts?: ProjectProps | {}) => {};
45
+ readonly uniformTypes: {
46
+ readonly wrapLongitude: "f32";
47
+ readonly coordinateSystem: "i32";
48
+ readonly commonUnitsPerMeter: "vec3<f32>";
49
+ readonly projectionMode: "i32";
50
+ readonly scale: "f32";
51
+ readonly commonUnitsPerWorldUnit: "vec3<f32>";
52
+ readonly commonUnitsPerWorldUnit2: "vec3<f32>";
53
+ readonly center: "vec4<f32>";
54
+ readonly modelMatrix: "mat4x4<f32>";
55
+ readonly viewProjectionMatrix: "mat4x4<f32>";
56
+ readonly viewportSize: "vec2<f32>";
57
+ readonly devicePixelRatio: "f32";
58
+ readonly focalDistance: "f32";
59
+ readonly cameraPosition: "vec3<f32>";
60
+ readonly coordinateOrigin: "vec3<f32>";
61
+ readonly commonOrigin: "vec3<f32>";
62
+ readonly pseudoMeters: "f32";
63
+ };
64
+ }];
65
+ readonly vs: string;
66
+ readonly fs: string;
67
+ readonly inject: {
68
+ readonly 'vs:#main-start': "\nif (terrain.mode == TERRAIN_MODE_SKIP) {\n gl_Position = vec4(0.0);\n return;\n}\n";
69
+ readonly 'vs:DECKGL_FILTER_GL_POSITION': "\ncommonPos = geometry.position.xyz;\nif (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {\n vec2 texCoords = (commonPos.xy - terrain.bounds.xy) / terrain.bounds.zw;\n position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);\n commonPos.z += project.commonOrigin.z;\n}\nif (terrain.mode == TERRAIN_MODE_USE_HEIGHT_MAP) {\n vec3 anchor = geometry.worldPosition;\n anchor.z = 0.0;\n vec3 anchorCommon = project_position(anchor);\n vec2 texCoords = (anchorCommon.xy - terrain.bounds.xy) / terrain.bounds.zw;\n if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {\n float terrainZ = texture(terrain_map, texCoords).r;\n geometry.position.z += terrainZ;\n position = project_common_position_to_clipspace(geometry.position);\n }\n}\n ";
70
+ readonly 'fs:#main-start': "\nif (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {\n fragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);\n return;\n}\n ";
71
+ readonly 'fs:DECKGL_FILTER_COLOR': "\nif ((terrain.mode == TERRAIN_MODE_USE_COVER) || (terrain.mode == TERRAIN_MODE_USE_COVER_ONLY)) {\n vec2 texCoords = (commonPos.xy - terrain.bounds.xy) / terrain.bounds.zw;\n vec4 pixel = texture(terrain_map, texCoords);\n if (terrain.mode == TERRAIN_MODE_USE_COVER_ONLY) {\n color = pixel;\n } else {\n // pixel is premultiplied\n color = pixel + color * (1.0 - pixel.a);\n }\n return;\n}\n ";
72
+ };
73
+ readonly getUniforms: (opts?: Partial<TerrainModuleProps>) => {
74
+ mode: number;
75
+ terrain_map: Texture;
76
+ bounds: [number, number, number, number];
77
+ } | {
78
+ mode?: undefined;
79
+ terrain_map?: undefined;
80
+ bounds?: undefined;
81
+ };
82
+ readonly uniformTypes: {
83
+ readonly mode: "f32";
84
+ readonly bounds: "vec4<f32>";
85
+ };
86
+ };
33
87
  //# sourceMappingURL=shader-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/terrain/shader-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAGvD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAC,MAAM,EAAC,qCAAkC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAGlD,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,CAAC;IAC9B,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,YAAY;;IAEvB,6EAA6E;;IAE7E,2EAA2E;;IAE3E,6FAA6F;;IAE7F,0EAA0E;;IAE1E,mEAAmE;;CAEpE,CAAC;AAMF,eAAO,MAAM,aAAa,qCA8Hc,CAAC"}
1
+ {"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/terrain/shader-module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,YAAY,EAA4B,MAAM,eAAe,CAAC;AAE/E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAC,MAAM,EAAC,qCAAkC;AACtD,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAElD,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,YAAY,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACnC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAWF,kDAAkD;AAClD,eAAO,MAAM,YAAY;;IAEvB,6EAA6E;;IAE7E,2EAA2E;;IAE3E,6FAA6F;;IAE7F,0EAA0E;;IAE1E,mEAAmE;;CAEpE,CAAC;AAkBF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAsDJ,OAAO,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;CAiEkD,CAAC"}
@@ -1,6 +1,7 @@
1
- /* eslint-disable camelcase */
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  import { project } from '@deck.gl/core';
3
- import { glsl } from "../utils/syntax-tags.js";
4
5
  /** A model can have one of the following modes */
5
6
  export const TERRAIN_MODE = {
6
7
  NONE: 0,
@@ -18,72 +19,76 @@ export const TERRAIN_MODE = {
18
19
  const TERRAIN_MODE_CONSTANTS = Object.keys(TERRAIN_MODE)
19
20
  .map(key => `const float TERRAIN_MODE_${key} = ${TERRAIN_MODE[key]}.0;`)
20
21
  .join('\n');
22
+ const uniformBlock =
23
+ // eslint-disable-next-line prefer-template
24
+ TERRAIN_MODE_CONSTANTS +
25
+ /* glsl */ `
26
+ uniform terrainUniforms {
27
+ float mode;
28
+ vec4 bounds;
29
+ } terrain;
30
+
31
+ uniform sampler2D terrain_map;
32
+ `;
21
33
  export const terrainModule = {
22
34
  name: 'terrain',
23
35
  dependencies: [project],
36
+ // eslint-disable-next-line prefer-template
37
+ vs: uniformBlock + /* glsl */ 'out vec3 commonPos;',
38
+ // eslint-disable-next-line prefer-template
39
+ fs: uniformBlock + /* glsl */ 'in vec3 commonPos;',
24
40
  inject: {
25
- 'vs:#decl': `
26
- uniform float terrain_mode;
27
- uniform sampler2D terrain_map;
28
- uniform vec4 terrain_bounds;
29
- out vec3 commonPos;
30
- ` + TERRAIN_MODE_CONSTANTS,
31
- 'vs:#main-start': `
32
- if (terrain_mode == TERRAIN_MODE_SKIP) {
33
- gl_Position = vec4(0.0);
34
- return;
41
+ 'vs:#main-start': /* glsl */ `
42
+ if (terrain.mode == TERRAIN_MODE_SKIP) {
43
+ gl_Position = vec4(0.0);
44
+ return;
35
45
  }
36
46
  `,
37
- 'vs:DECKGL_FILTER_GL_POSITION': `
47
+ 'vs:DECKGL_FILTER_GL_POSITION': /* glsl */ `
38
48
  commonPos = geometry.position.xyz;
39
- if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
40
- vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
41
- position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);
42
- commonPos.z += project_uCommonOrigin.z;
43
- }
44
- if (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
45
- vec3 anchor = geometry.worldPosition;
46
- anchor.z = 0.0;
47
- vec3 anchorCommon = project_position(anchor);
48
- vec2 texCoords = (anchorCommon.xy - terrain_bounds.xy) / terrain_bounds.zw;
49
- if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {
50
- float terrainZ = texture(terrain_map, texCoords).r;
51
- geometry.position.z += terrainZ;
52
- position = project_common_position_to_clipspace(geometry.position);
53
- }
49
+ if (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
50
+ vec2 texCoords = (commonPos.xy - terrain.bounds.xy) / terrain.bounds.zw;
51
+ position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);
52
+ commonPos.z += project.commonOrigin.z;
54
53
  }
55
- `,
56
- 'fs:#decl': `
57
- uniform float terrain_mode;
58
- uniform sampler2D terrain_map;
59
- uniform vec4 terrain_bounds;
60
- in vec3 commonPos;
61
- ` + TERRAIN_MODE_CONSTANTS,
62
- 'fs:#main-start': `
63
- if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
64
- fragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);
65
- return;
54
+ if (terrain.mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
55
+ vec3 anchor = geometry.worldPosition;
56
+ anchor.z = 0.0;
57
+ vec3 anchorCommon = project_position(anchor);
58
+ vec2 texCoords = (anchorCommon.xy - terrain.bounds.xy) / terrain.bounds.zw;
59
+ if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {
60
+ float terrainZ = texture(terrain_map, texCoords).r;
61
+ geometry.position.z += terrainZ;
62
+ position = project_common_position_to_clipspace(geometry.position);
63
+ }
66
64
  }
67
- `,
68
- 'fs:DECKGL_FILTER_COLOR': `
69
- if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY)) {
70
- vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
71
- vec4 pixel = texture(terrain_map, texCoords);
72
- if (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY) {
73
- color = pixel;
74
- } else {
75
- color = pixel + color * (1.0 - pixel.a);
65
+ `,
66
+ 'fs:#main-start': /* glsl */ `
67
+ if (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
68
+ fragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);
69
+ return;
76
70
  }
77
- return;
71
+ `,
72
+ 'fs:DECKGL_FILTER_COLOR': /* glsl */ `
73
+ if ((terrain.mode == TERRAIN_MODE_USE_COVER) || (terrain.mode == TERRAIN_MODE_USE_COVER_ONLY)) {
74
+ vec2 texCoords = (commonPos.xy - terrain.bounds.xy) / terrain.bounds.zw;
75
+ vec4 pixel = texture(terrain_map, texCoords);
76
+ if (terrain.mode == TERRAIN_MODE_USE_COVER_ONLY) {
77
+ color = pixel;
78
+ } else {
79
+ // pixel is premultiplied
80
+ color = pixel + color * (1.0 - pixel.a);
81
+ }
82
+ return;
78
83
  }
79
- `
84
+ `
80
85
  },
81
86
  // eslint-disable-next-line complexity
82
- getUniforms: (opts = {}, uniforms) => {
87
+ getUniforms: (opts = {}) => {
83
88
  if ('dummyHeightMap' in opts) {
84
89
  const { drawToTerrainHeightMap, heightMap, heightMapBounds, dummyHeightMap, terrainCover, useTerrainHeightMap, terrainSkipRender } = opts;
85
- // @ts-expect-error stricter luma gl types
86
- const { project_uCommonOrigin } = uniforms;
90
+ const projectUniforms = project.getUniforms(opts.project);
91
+ const { commonOrigin } = projectUniforms;
87
92
  let mode = terrainSkipRender ? TERRAIN_MODE.SKIP : TERRAIN_MODE.NONE;
88
93
  // height map if case USE_HEIGHT_MAP, terrain cover if USE_COVER, otherwise empty
89
94
  let sampler = dummyHeightMap;
@@ -100,12 +105,11 @@ return;
100
105
  }
101
106
  else if (terrainCover) {
102
107
  // This is a terrain layer
103
- const isPicking = opts.picking?.isActive;
104
- const fbo = isPicking
108
+ const fbo = opts.isPicking
105
109
  ? terrainCover.getPickingFramebuffer()
106
110
  : terrainCover.getRenderFramebuffer();
107
111
  sampler = fbo?.colorAttachments[0].texture;
108
- if (isPicking) {
112
+ if (opts.isPicking) {
109
113
  // Never render the layer itself in picking pass
110
114
  mode = TERRAIN_MODE.SKIP;
111
115
  }
@@ -119,19 +123,23 @@ return;
119
123
  }
120
124
  /* eslint-disable camelcase */
121
125
  return {
122
- terrain_mode: mode,
126
+ mode,
123
127
  terrain_map: sampler,
124
128
  // Convert bounds to the common space, as [minX, minY, width, height]
125
- terrain_bounds: bounds
129
+ bounds: bounds
126
130
  ? [
127
- bounds[0] - project_uCommonOrigin[0],
128
- bounds[1] - project_uCommonOrigin[1],
131
+ bounds[0] - commonOrigin[0],
132
+ bounds[1] - commonOrigin[1],
129
133
  bounds[2] - bounds[0],
130
134
  bounds[3] - bounds[1]
131
135
  ]
132
136
  : [0, 0, 0, 0]
133
137
  };
134
138
  }
135
- return null;
139
+ return {};
140
+ },
141
+ uniformTypes: {
142
+ mode: 'f32',
143
+ bounds: 'vec4<f32>'
136
144
  }
137
145
  };
@@ -1 +1 @@
1
- {"version":3,"file":"terrain-cover.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-cover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAC,KAAK,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAiD,MAAM,EAAC,qCAAkC;AAMjG;;;;;;GAMG;AACH,qBAAa,YAAY;IACvB,OAAO,EAAE,OAAO,CAAQ;IACxB,sDAAsD;IACtD,WAAW,EAAE,KAAK,CAAC;IACnB,6CAA6C;IAC7C,cAAc,EAAE,QAAQ,GAAG,IAAI,CAAQ;IACvC,8DAA8D;IAC9D,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE7B,OAAO,CAAC,GAAG,CAAC,CAAc;IAC1B,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,IAAI,CAAoB;IAChC,gDAAgD;IAChD,OAAO,CAAC,YAAY,CAAqC;IACzD,sCAAsC;IACtC,OAAO,CAAC,kBAAkB,CAAuB;gBAErC,WAAW,EAAE,KAAK;IAK9B,IAAI,EAAE,WAEL;IAED,4EAA4E;IAC5E,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,YAAY,CAAC,EACX,WAAW,EACX,QAAQ,EACR,MAAM,EACN,gBAAgB,EACjB,EAAE;QACD,WAAW,CAAC,EAAE,KAAK,CAAC;QACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,MAAM,CAAC,EAAE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AC,EAAE,KAAK,CAAC;QACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;QACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5C,GAAG,OAAO;IAqBX,wEAAwE;IACxE,OAAO,CAAC,aAAa;IAuBrB,4FAA4F;IAC5F,OAAO,CAAC,eAAe;IAsDvB,oBAAoB,IAAI,WAAW,GAAG,IAAI;IAU1C,qBAAqB,IAAI,WAAW,GAAG,IAAI;IAa3C,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE;IAI5B,MAAM;CAWP"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { createRenderTarget } from "./utils.js";
2
5
  import { joinLayerBounds, makeViewport, getRenderBounds } from "../utils/projection-utils.js";
3
6
  /**
@@ -1,4 +1,4 @@
1
- import { TerrainModuleSettings } from "./shader-module.js";
1
+ import { TerrainModuleProps } from "./shader-module.js";
2
2
  import type { Effect, EffectContext, PreRenderOptions, Layer } from '@deck.gl/core';
3
3
  /** Class to manage terrain effect */
4
4
  export declare class TerrainEffect implements Effect {
@@ -19,7 +19,9 @@ export declare class TerrainEffect implements Effect {
19
19
  private terrainCovers;
20
20
  setup({ device, deck }: EffectContext): void;
21
21
  preRender(opts: PreRenderOptions): void;
22
- getModuleParameters(layer: Layer): Omit<TerrainModuleSettings, 'picking'>;
22
+ getShaderModuleProps(layer: Layer, otherShaderModuleProps: Record<string, any>): {
23
+ terrain: TerrainModuleProps;
24
+ };
23
25
  cleanup({ deck }: EffectContext): void;
24
26
  private _updateHeightMap;
25
27
  private _updateTerrainCovers;
@@ -1 +1 @@
1
- {"version":3,"file":"terrain-effect.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-effect.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,qBAAqB,EAAC,2BAAwB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C;IAC1C,OAAO,CAAC,SAAS,CAAkB;IACnC,6CAA6C;IAC7C,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,sCAAsC;IACtC,OAAO,CAAC,cAAc,CAAC,CAAU;IACjC,wGAAwG;IACxG,OAAO,CAAC,SAAS,CAAC,CAAmB;IACrC,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,wFAAwF;IACxF,OAAO,CAAC,aAAa,CAAwC;IAE7D,KAAK,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,EAAE,aAAa;IAkBnC,SAAS,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAoCvC,oBAAoB,CAClB,KAAK,EAAE,KAAK,EACZ,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1C;QAAC,OAAO,EAAE,kBAAkB,CAAA;KAAC;IAiBhC,OAAO,CAAC,EAAC,IAAI,EAAC,EAAE,aAAa,GAAG,IAAI;IAmBpC,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,mBAAmB;CAY5B"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { log } from '@deck.gl/core';
2
5
  import { terrainModule } from "./shader-module.js";
3
6
  import { TerrainCover } from "./terrain-cover.js";
@@ -31,7 +34,6 @@ export class TerrainEffect {
31
34
  else {
32
35
  log.warn('Terrain offset mode is not supported by this browser')();
33
36
  }
34
- // @ts-expect-error stricter luma gl types
35
37
  deck._addDefaultShaderModule(terrainModule);
36
38
  }
37
39
  preRender(opts) {
@@ -61,15 +63,19 @@ export class TerrainEffect {
61
63
  const drapeLayers = layers.filter(l => l.state.terrainDrawMode === 'drape');
62
64
  this._updateTerrainCovers(terrainLayers, drapeLayers, viewport, opts);
63
65
  }
64
- getModuleParameters(layer) {
66
+ getShaderModuleProps(layer, otherShaderModuleProps) {
65
67
  const { terrainDrawMode } = layer.state;
66
68
  return {
67
- heightMap: this.heightMap?.getRenderFramebuffer()?.colorAttachments[0].texture || null,
68
- heightMapBounds: this.heightMap?.bounds,
69
- dummyHeightMap: this.dummyHeightMap,
70
- terrainCover: this.isDrapingEnabled ? this.terrainCovers.get(layer.id) : null,
71
- useTerrainHeightMap: terrainDrawMode === 'offset',
72
- terrainSkipRender: terrainDrawMode === 'drape' || !layer.props.operation.includes('draw')
69
+ terrain: {
70
+ project: otherShaderModuleProps.project,
71
+ isPicking: this.isPicking,
72
+ heightMap: this.heightMap?.getRenderFramebuffer()?.colorAttachments[0].texture || null,
73
+ heightMapBounds: this.heightMap?.bounds,
74
+ dummyHeightMap: this.dummyHeightMap,
75
+ terrainCover: this.isDrapingEnabled ? this.terrainCovers.get(layer.id) : null,
76
+ useTerrainHeightMap: terrainDrawMode === 'offset',
77
+ terrainSkipRender: terrainDrawMode === 'drape' || !layer.props.operation.includes('draw')
78
+ }
73
79
  };
74
80
  }
75
81
  cleanup({ deck }) {
@@ -85,7 +91,6 @@ export class TerrainEffect {
85
91
  terrainCover.delete();
86
92
  }
87
93
  this.terrainCovers.clear();
88
- // @ts-expect-error stricter luma gl types
89
94
  deck._removeDefaultShaderModule(terrainModule);
90
95
  }
91
96
  _updateHeightMap(terrainLayers, viewport, opts) {
@@ -100,11 +105,15 @@ export class TerrainEffect {
100
105
  this.terrainPass.renderHeightMap(this.heightMap, {
101
106
  ...opts,
102
107
  layers: terrainLayers,
103
- moduleParameters: {
104
- heightMapBounds: this.heightMap.bounds,
105
- dummyHeightMap: this.dummyHeightMap,
106
- devicePixelRatio: 1,
107
- drawToTerrainHeightMap: true
108
+ shaderModuleProps: {
109
+ terrain: {
110
+ heightMapBounds: this.heightMap.bounds,
111
+ dummyHeightMap: this.dummyHeightMap,
112
+ drawToTerrainHeightMap: true
113
+ },
114
+ project: {
115
+ devicePixelRatio: 1
116
+ }
108
117
  }
109
118
  });
110
119
  }
@@ -144,10 +153,14 @@ export class TerrainEffect {
144
153
  renderPass.renderTerrainCover(terrainCover, {
145
154
  ...opts,
146
155
  layers: drapeLayers,
147
- moduleParameters: {
148
- dummyHeightMap: this.dummyHeightMap,
149
- terrainSkipRender: false,
150
- devicePixelRatio: 1
156
+ shaderModuleProps: {
157
+ terrain: {
158
+ dummyHeightMap: this.dummyHeightMap,
159
+ terrainSkipRender: false
160
+ },
161
+ project: {
162
+ devicePixelRatio: 1
163
+ }
151
164
  }
152
165
  });
153
166
  if (!this.isPicking) {
@@ -1 +1 @@
1
- {"version":3,"file":"terrain-extension.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAI/D,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAMzC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtC,CAAC;AASF,wDAAwD;AACxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,MAAM,CAAC,YAAY;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAsB;IAE1C,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,GAAG;IAMnD,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC;IAIlD,WAAW,CACT,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC,EAClC,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAyBxD,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI;CAMrC"}
1
+ {"version":3,"file":"terrain-extension.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAI/D,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAMzC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CACtC,CAAC;AASF,wDAAwD;AACxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,MAAM,CAAC,YAAY;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAsB;IAE1C,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC,GAAG,GAAG;IAMnD,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC;IAIlD,WAAW,CACT,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC,EAClC,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAyBxD,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI;CAMrC"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { LayerExtension } from '@deck.gl/core';
2
5
  import { TerrainEffect } from "./terrain-effect.js";
3
6
  import { terrainModule } from "./shader-module.js";
@@ -8,46 +8,51 @@ export declare class TerrainPass extends LayersPass {
8
8
  renderHeightMap(heightMap: HeightMapBuilder, opts: Partial<TerrainPassRenderOptions>): void;
9
9
  renderTerrainCover(terrainCover: TerrainCover, opts: Partial<TerrainPassRenderOptions>): void;
10
10
  protected getLayerParameters(layer: Layer<{}>, layerIndex: number, viewport: Viewport): {
11
- cullMode?: import("@luma.gl/core").CullMode | undefined;
12
- frontFace?: import("@luma.gl/core").FrontFace | undefined;
13
- depthBias?: number | undefined;
14
- depthBiasSlopeScale?: number | undefined;
15
- depthBiasClamp?: number | undefined;
16
- unclippedDepth?: boolean | undefined;
17
- provokingVertex?: "first" | "last" | undefined;
18
- polygonMode?: "fill" | "line" | undefined;
19
- polygonOffsetLine?: boolean | undefined;
20
- clipDistance0?: boolean | undefined;
21
- clipDistance1?: boolean | undefined;
22
- clipDistance2?: boolean | undefined;
23
- clipDistance3?: boolean | undefined;
24
- clipDistance4?: boolean | undefined;
25
- clipDistance5?: boolean | undefined;
26
- clipDistance6?: boolean | undefined;
27
- clipDistance7?: boolean | undefined;
28
- topology?: import("@luma.gl/core").PrimitiveTopology | undefined;
29
- stripIndexFormat?: import("@luma.gl/core").IndexFormat | undefined;
30
- depthWriteEnabled?: boolean | undefined;
31
- depthCompare?: import("@luma.gl/core").CompareFunction | undefined;
32
- depthFormat?: import("@luma.gl/core").DepthStencilTextureFormat | undefined;
33
- stencilReadMask?: number | undefined;
34
- stencilWriteMask?: number | undefined;
35
- stencilCompare?: import("@luma.gl/core").CompareFunction | undefined;
36
- stencilPassOperation?: import("@luma.gl/core").StencilOperation | undefined;
37
- stencilFailOperation?: import("@luma.gl/core").StencilOperation | undefined;
38
- stencilDepthFailOperation?: import("@luma.gl/core").StencilOperation | undefined;
39
- blendColorOperation?: import("@luma.gl/core").BlendOperation | undefined;
40
- blendColorSrcFactor?: import("@luma.gl/core").BlendFactor | undefined;
41
- blendColorDstFactor?: import("@luma.gl/core").BlendFactor | undefined;
42
- blendAlphaOperation?: import("@luma.gl/core").BlendOperation | undefined;
43
- blendAlphaSrcFactor?: import("@luma.gl/core").BlendFactor | undefined;
44
- blendAlphaDstFactor?: import("@luma.gl/core").BlendFactor | undefined;
45
- colorMask?: number | undefined;
46
- sampleCount?: number | undefined;
47
- sampleMask?: number | undefined;
48
- sampleAlphaToCoverageEnabled?: boolean | undefined;
11
+ cullMode?: import("@luma.gl/core").CullMode;
12
+ frontFace?: import("@luma.gl/core").FrontFace;
13
+ depthBias?: number;
14
+ depthBiasSlopeScale?: number;
15
+ depthBiasClamp?: number;
16
+ unclippedDepth?: boolean;
17
+ provokingVertex?: "first" | "last";
18
+ polygonMode?: "fill" | "line";
19
+ polygonOffsetLine?: boolean;
20
+ clipDistance0?: boolean;
21
+ clipDistance1?: boolean;
22
+ clipDistance2?: boolean;
23
+ clipDistance3?: boolean;
24
+ clipDistance4?: boolean;
25
+ clipDistance5?: boolean;
26
+ clipDistance6?: boolean;
27
+ clipDistance7?: boolean;
28
+ topology?: import("@luma.gl/core").PrimitiveTopology;
29
+ stripIndexFormat?: import("@luma.gl/core").IndexFormat;
30
+ depthWriteEnabled?: boolean;
31
+ depthCompare?: import("@luma.gl/core").CompareFunction;
32
+ depthFormat?: import("@luma.gl/core").DepthStencilTextureFormat;
33
+ stencilReadMask?: number;
34
+ stencilWriteMask?: number;
35
+ stencilCompare?: import("@luma.gl/core").CompareFunction;
36
+ stencilPassOperation?: import("@luma.gl/core").StencilOperation;
37
+ stencilFailOperation?: import("@luma.gl/core").StencilOperation;
38
+ stencilDepthFailOperation?: import("@luma.gl/core").StencilOperation;
49
39
  blend: boolean;
40
+ blendColorOperation?: import("@luma.gl/core").BlendOperation;
41
+ blendColorSrcFactor?: import("@luma.gl/core").BlendFactor;
42
+ blendColorDstFactor?: import("@luma.gl/core").BlendFactor;
43
+ blendAlphaOperation?: import("@luma.gl/core").BlendOperation;
44
+ blendAlphaSrcFactor?: import("@luma.gl/core").BlendFactor;
45
+ blendAlphaDstFactor?: import("@luma.gl/core").BlendFactor;
46
+ colorMask?: number;
47
+ sampleCount?: number;
48
+ sampleMask?: number;
49
+ sampleAlphaToCoverageEnabled?: boolean;
50
50
  depthTest: boolean;
51
51
  };
52
+ getShaderModuleProps(layer: Layer, effects: any, otherShaderModuleProps: Record<string, any>): {
53
+ terrain: {
54
+ project: any;
55
+ };
56
+ };
52
57
  }
53
58
  //# sourceMappingURL=terrain-pass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"terrain-pass.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-pass.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KA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AwB,CAAC;IAsBpF,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,wBAAwB,CAAC;IAuBtF,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASrF,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;CAO7F"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { _LayersPass as LayersPass } from '@deck.gl/core';
2
5
  const TERRAIN_BLENDING = {
3
6
  blendColorOperation: 'max',
@@ -66,4 +69,11 @@ export class TerrainPass extends LayersPass {
66
69
  ...(layer.props.operation.includes('terrain') && TERRAIN_BLENDING)
67
70
  };
68
71
  }
72
+ getShaderModuleProps(layer, effects, otherShaderModuleProps) {
73
+ return {
74
+ terrain: {
75
+ project: otherShaderModuleProps.project
76
+ }
77
+ };
78
+ }
69
79
  }
@@ -15,5 +15,10 @@ export declare class TerrainPickingPass extends PickLayersPass {
15
15
  getRenderableLayers(viewport: Viewport, opts: TerrainPickingPassRenderOptions): Layer[];
16
16
  renderTerrainCover(terrainCover: TerrainCover, opts: Partial<TerrainPickingPassRenderOptions>): void;
17
17
  protected getLayerParameters(layer: Layer, layerIndex: number, viewport: Viewport): any;
18
+ getShaderModuleProps(layer: Layer, effects: any, otherShaderModuleProps: Record<string, any>): {
19
+ terrain: {
20
+ project: any;
21
+ };
22
+ };
18
23
  }
19
24
  //# sourceMappingURL=terrain-picking-pass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"terrain-picking-pass.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-picking-pass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Y,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,+BAA+B,CAAC;IA+B7F,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAWvF,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;CAO7F"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { _PickLayersPass as PickLayersPass } from '@deck.gl/core';
2
5
  /** Renders textures used by the TerrainEffect picking pass */
3
6
  export class TerrainPickingPass extends PickLayersPass {
@@ -64,4 +67,11 @@ export class TerrainPickingPass extends PickLayersPass {
64
67
  }
65
68
  return { ...parameters, depthTest: false };
66
69
  }
70
+ getShaderModuleProps(layer, effects, otherShaderModuleProps) {
71
+ return {
72
+ terrain: {
73
+ project: otherShaderModuleProps.project
74
+ }
75
+ };
76
+ }
67
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/terrain/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAG1C,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,uCAyBF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/terrain/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAG1C,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,uCAyBF"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { GL } from '@luma.gl/constants';
2
5
  export function createRenderTarget(device, opts) {
3
6
  return device.createFramebuffer({
@@ -1,7 +1,7 @@
1
1
  import { Framebuffer } from '@luma.gl/core';
2
2
  /** Debug utility to draw FBO contents onto screen */
3
3
  export declare const debugFBO: (fbo: Framebuffer, { minimap, opaque }?: {
4
- minimap?: boolean | undefined;
5
- opaque?: boolean | undefined;
4
+ minimap?: boolean;
5
+ opaque?: boolean;
6
6
  }) => void;
7
7
  //# sourceMappingURL=debug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,qDAAqD;AAErD,eAAO,MAAM,QAAQ,QACd,WAAW;;;UAmDjB,CAAC"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,qDAAqD;AAErD,eAAO,MAAM,QAAQ,QACd,WAAW,wBACG;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAC,SAkDzD,CAAC"}
@@ -1,4 +1,6 @@
1
- /* global document */
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
2
4
  /** Debug utility to draw FBO contents onto screen */
3
5
  // eslint-disable-next-line
4
6
  export const debugFBO = function (fbo, { minimap, opaque } = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"projection-utils.d.ts","sourceRoot":"","sources":["../../src/utils/projection-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,KAAK,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEnD,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAM9E,wBAAgB,eAAe;AAC7B,4BAA4B;AAC5B,MAAM,EAAE,KAAK,EAAE;AACf,yEAAyE;AACzE,QAAQ,EAAE,QAAQ,GACjB,MAAM,GAAG,IAAI,CAoBf;AAID,mHAAmH;AACnH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,QAAQ,EAAE,QAAQ,CAAC;CACpB,GAAG,QAAQ,GAAG,IAAI,CA2DlB;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CA0BvF;AAMD,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,MAAM,CA+BR"}
1
+ {"version":3,"file":"projection-utils.d.ts","sourceRoot":"","sources":["../../src/utils/projection-utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,KAAK,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEnD,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAM9E,wBAAgB,eAAe;AAC7B,4BAA4B;AAC5B,MAAM,EAAE,KAAK,EAAE;AACf,yEAAyE;AACzE,QAAQ,EAAE,QAAQ,GACjB,MAAM,GAAG,IAAI,CAoBf;AAID,mHAAmH;AACnH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,QAAQ,EAAE,QAAQ,CAAC;CACpB,GAAG,QAAQ,GAAG,IAAI,CA2DlB;AAED,uDAAuD;AACvD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CA0BvF;AAMD,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EAClB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,MAAM,CA+BR"}
@@ -1,3 +1,6 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
1
4
  import { WebMercatorViewport, OrthographicViewport } from '@deck.gl/core';
2
5
  /*
3
6
  * Compute the union of bounds from multiple layers