@deck.gl/extensions 9.0.40 → 9.1.0-beta.3

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 (160) 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 +16 -19
  4. package/dist/brushing/brushing-extension.js.map +1 -0
  5. package/dist/brushing/shader-module.d.ts +8 -2
  6. package/dist/brushing/shader-module.d.ts.map +1 -1
  7. package/dist/brushing/shader-module.js +75 -50
  8. package/dist/brushing/shader-module.js.map +1 -0
  9. package/dist/clip/clip-extension.d.ts +5 -2
  10. package/dist/clip/clip-extension.d.ts.map +1 -1
  11. package/dist/clip/clip-extension.js +37 -42
  12. package/dist/clip/clip-extension.js.map +1 -0
  13. package/dist/collision-filter/collision-filter-effect.d.ts +4 -4
  14. package/dist/collision-filter/collision-filter-effect.d.ts.map +1 -1
  15. package/dist/collision-filter/collision-filter-effect.js +28 -13
  16. package/dist/collision-filter/collision-filter-effect.js.map +1 -0
  17. package/dist/collision-filter/collision-filter-extension.d.ts +1 -1
  18. package/dist/collision-filter/collision-filter-extension.d.ts.map +1 -1
  19. package/dist/collision-filter/collision-filter-extension.js +6 -6
  20. package/dist/collision-filter/collision-filter-extension.js.map +1 -0
  21. package/dist/collision-filter/collision-filter-pass.d.ts +9 -5
  22. package/dist/collision-filter/collision-filter-pass.d.ts.map +1 -1
  23. package/dist/collision-filter/collision-filter-pass.js +15 -4
  24. package/dist/collision-filter/collision-filter-pass.js.map +1 -0
  25. package/dist/collision-filter/shader-module.d.ts +3 -2
  26. package/dist/collision-filter/shader-module.d.ts.map +1 -1
  27. package/dist/collision-filter/shader-module.js +75 -52
  28. package/dist/collision-filter/shader-module.js.map +1 -0
  29. package/dist/data-filter/aggregator.d.ts +4 -10
  30. package/dist/data-filter/aggregator.d.ts.map +1 -1
  31. package/dist/data-filter/aggregator.js +15 -8
  32. package/dist/data-filter/aggregator.js.map +1 -0
  33. package/dist/data-filter/data-filter-extension.d.ts.map +1 -1
  34. package/dist/data-filter/data-filter-extension.js +49 -39
  35. package/dist/data-filter/data-filter-extension.js.map +1 -0
  36. package/dist/data-filter/shader-module.d.ts +12 -5
  37. package/dist/data-filter/shader-module.d.ts.map +1 -1
  38. package/dist/data-filter/shader-module.js +190 -131
  39. package/dist/data-filter/shader-module.js.map +1 -0
  40. package/dist/dist.dev.js +2720 -2037
  41. package/dist/fill-style/fill-style-extension.d.ts.map +1 -1
  42. package/dist/fill-style/fill-style-extension.js +12 -4
  43. package/dist/fill-style/fill-style-extension.js.map +1 -0
  44. package/dist/fill-style/shader-module.d.ts +64 -6
  45. package/dist/fill-style/shader-module.d.ts.map +1 -1
  46. package/dist/fill-style/shader-module.js +74 -51
  47. package/dist/fill-style/shader-module.js.map +1 -0
  48. package/dist/fp64/fp64-extension.d.ts +1 -0
  49. package/dist/fp64/fp64-extension.d.ts.map +1 -1
  50. package/dist/fp64/fp64-extension.js +8 -19
  51. package/dist/fp64/fp64-extension.js.map +1 -0
  52. package/dist/fp64/project64.d.ts +2 -2
  53. package/dist/fp64/project64.d.ts.map +1 -1
  54. package/dist/fp64/project64.glsl.d.ts +1 -1
  55. package/dist/fp64/project64.glsl.d.ts.map +1 -1
  56. package/dist/fp64/project64.glsl.js +19 -21
  57. package/dist/fp64/project64.glsl.js.map +1 -0
  58. package/dist/fp64/project64.js +25 -24
  59. package/dist/fp64/project64.js.map +1 -0
  60. package/dist/index.cjs +1034 -528
  61. package/dist/index.cjs.map +4 -4
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +4 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/mask/mask-effect.d.ts +5 -3
  67. package/dist/mask/mask-effect.d.ts.map +1 -1
  68. package/dist/mask/mask-effect.js +13 -5
  69. package/dist/mask/mask-effect.js.map +1 -0
  70. package/dist/mask/mask-extension.d.ts +1 -1
  71. package/dist/mask/mask-extension.d.ts.map +1 -1
  72. package/dist/mask/mask-extension.js +14 -8
  73. package/dist/mask/mask-extension.js.map +1 -0
  74. package/dist/mask/mask-pass.d.ts +2 -43
  75. package/dist/mask/mask-pass.d.ts.map +1 -1
  76. package/dist/mask/mask-pass.js +5 -1
  77. package/dist/mask/mask-pass.js.map +1 -0
  78. package/dist/mask/shader-module.d.ts +60 -3
  79. package/dist/mask/shader-module.d.ts.map +1 -1
  80. package/dist/mask/shader-module.js +74 -46
  81. package/dist/mask/shader-module.js.map +1 -0
  82. package/dist/path-style/path-style-extension.d.ts.map +1 -1
  83. package/dist/path-style/path-style-extension.js +21 -24
  84. package/dist/path-style/path-style-extension.js.map +1 -0
  85. package/dist/path-style/shaders.glsl.d.ts.map +1 -1
  86. package/dist/path-style/shaders.glsl.js +12 -7
  87. package/dist/path-style/shaders.glsl.js.map +1 -0
  88. package/dist/terrain/height-map-builder.d.ts.map +1 -1
  89. package/dist/terrain/height-map-builder.js +4 -0
  90. package/dist/terrain/height-map-builder.js.map +1 -0
  91. package/dist/terrain/shader-module.d.ts +60 -6
  92. package/dist/terrain/shader-module.d.ts.map +1 -1
  93. package/dist/terrain/shader-module.js +70 -61
  94. package/dist/terrain/shader-module.js.map +1 -0
  95. package/dist/terrain/terrain-cover.d.ts.map +1 -1
  96. package/dist/terrain/terrain-cover.js +4 -0
  97. package/dist/terrain/terrain-cover.js.map +1 -0
  98. package/dist/terrain/terrain-effect.d.ts +4 -2
  99. package/dist/terrain/terrain-effect.d.ts.map +1 -1
  100. package/dist/terrain/terrain-effect.js +32 -18
  101. package/dist/terrain/terrain-effect.js.map +1 -0
  102. package/dist/terrain/terrain-extension.d.ts.map +1 -1
  103. package/dist/terrain/terrain-extension.js +4 -0
  104. package/dist/terrain/terrain-extension.js.map +1 -0
  105. package/dist/terrain/terrain-pass.d.ts +6 -41
  106. package/dist/terrain/terrain-pass.d.ts.map +1 -1
  107. package/dist/terrain/terrain-pass.js +12 -1
  108. package/dist/terrain/terrain-pass.js.map +1 -0
  109. package/dist/terrain/terrain-picking-pass.d.ts +7 -1
  110. package/dist/terrain/terrain-picking-pass.d.ts.map +1 -1
  111. package/dist/terrain/terrain-picking-pass.js +12 -1
  112. package/dist/terrain/terrain-picking-pass.js.map +1 -0
  113. package/dist/terrain/utils.d.ts.map +1 -1
  114. package/dist/terrain/utils.js +4 -0
  115. package/dist/terrain/utils.js.map +1 -0
  116. package/dist/utils/debug.d.ts +2 -2
  117. package/dist/utils/debug.d.ts.map +1 -1
  118. package/dist/utils/debug.js +4 -1
  119. package/dist/utils/debug.js.map +1 -0
  120. package/dist/utils/projection-utils.d.ts.map +1 -1
  121. package/dist/utils/projection-utils.js +4 -0
  122. package/dist/utils/projection-utils.js.map +1 -0
  123. package/dist.min.js +1102 -817
  124. package/package.json +8 -8
  125. package/src/brushing/brushing-extension.ts +17 -20
  126. package/src/brushing/shader-module.ts +58 -47
  127. package/src/clip/clip-extension.ts +38 -40
  128. package/src/collision-filter/collision-filter-effect.ts +31 -20
  129. package/src/collision-filter/collision-filter-extension.ts +6 -7
  130. package/src/collision-filter/collision-filter-pass.ts +17 -6
  131. package/src/collision-filter/shader-module.ts +40 -22
  132. package/src/data-filter/aggregator.ts +23 -11
  133. package/src/data-filter/data-filter-extension.ts +76 -49
  134. package/src/data-filter/shader-module.ts +150 -90
  135. package/src/fill-style/fill-style-extension.ts +13 -5
  136. package/src/fill-style/shader-module.ts +84 -52
  137. package/src/fp64/fp64-extension.ts +8 -19
  138. package/src/fp64/project64.glsl.ts +18 -21
  139. package/src/fp64/project64.ts +27 -28
  140. package/src/index.ts +5 -0
  141. package/src/mask/mask-effect.ts +17 -7
  142. package/src/mask/mask-extension.ts +16 -9
  143. package/src/mask/mask-pass.ts +17 -3
  144. package/src/mask/shader-module.ts +63 -27
  145. package/src/path-style/path-style-extension.ts +27 -28
  146. package/src/path-style/shaders.glsl.ts +13 -7
  147. package/src/terrain/height-map-builder.ts +4 -0
  148. package/src/terrain/shader-module.ts +62 -44
  149. package/src/terrain/terrain-cover.ts +4 -0
  150. package/src/terrain/terrain-effect.ts +36 -19
  151. package/src/terrain/terrain-extension.ts +4 -0
  152. package/src/terrain/terrain-pass.ts +19 -3
  153. package/src/terrain/terrain-picking-pass.ts +15 -2
  154. package/src/terrain/utils.ts +4 -0
  155. package/src/utils/debug.ts +4 -0
  156. package/src/utils/projection-utils.ts +4 -0
  157. package/dist/utils/syntax-tags.d.ts +0 -6
  158. package/dist/utils/syntax-tags.d.ts.map +0 -1
  159. package/dist/utils/syntax-tags.js +0 -5
  160. package/src/utils/syntax-tags.ts +0 -5
@@ -1,16 +1,20 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  /* eslint-disable camelcase */
2
6
 
3
7
  import type {ShaderModule} from '@luma.gl/shadertools';
4
- import {project} from '@deck.gl/core';
8
+ import {project, ProjectProps, ProjectUniforms} from '@deck.gl/core';
5
9
 
6
10
  import type {Texture} from '@luma.gl/core';
7
11
  import type {Bounds} from '../utils/projection-utils';
8
12
  import type {TerrainCover} from './terrain-cover';
9
- import {glsl} from '../utils/syntax-tags';
10
13
 
11
14
  /** Module parameters expected by the terrain shader module */
12
- export type TerrainModuleSettings = {
13
- picking: {isActive?: boolean};
15
+ export type TerrainModuleProps = {
16
+ project: ProjectProps;
17
+ isPicking: boolean;
14
18
  heightMap: Texture | null;
15
19
  heightMapBounds?: Bounds | null;
16
20
  dummyHeightMap: Texture;
@@ -20,6 +24,15 @@ export type TerrainModuleSettings = {
20
24
  terrainSkipRender?: boolean;
21
25
  };
22
26
 
27
+ type TerrainModuleUniforms = {
28
+ mode: number;
29
+ bounds: [number, number, number, number];
30
+ };
31
+
32
+ type TerrainModuleBindings = {
33
+ terrain_map: Texture;
34
+ };
35
+
23
36
  /** A model can have one of the following modes */
24
37
  export const TERRAIN_MODE = {
25
38
  NONE: 0,
@@ -39,35 +52,44 @@ const TERRAIN_MODE_CONSTANTS = Object.keys(TERRAIN_MODE)
39
52
  .map(key => `const float TERRAIN_MODE_${key} = ${TERRAIN_MODE[key]}.0;`)
40
53
  .join('\n');
41
54
 
55
+ const uniformBlock =
56
+ // eslint-disable-next-line prefer-template
57
+ TERRAIN_MODE_CONSTANTS +
58
+ /* glsl */ `
59
+ uniform terrainUniforms {
60
+ float mode;
61
+ vec4 bounds;
62
+ } terrain;
63
+
64
+ uniform sampler2D terrain_map;
65
+ `;
66
+
42
67
  export const terrainModule = {
43
68
  name: 'terrain',
44
69
  dependencies: [project],
70
+ // eslint-disable-next-line prefer-template
71
+ vs: uniformBlock + /* glsl */ 'out vec3 commonPos;',
72
+ // eslint-disable-next-line prefer-template
73
+ fs: uniformBlock + /* glsl */ 'in vec3 commonPos;',
45
74
  inject: {
46
- 'vs:#decl':
47
- glsl`
48
- uniform float terrain_mode;
49
- uniform sampler2D terrain_map;
50
- uniform vec4 terrain_bounds;
51
- out vec3 commonPos;
52
- ` + TERRAIN_MODE_CONSTANTS,
53
- 'vs:#main-start': glsl`
54
- if (terrain_mode == TERRAIN_MODE_SKIP) {
75
+ 'vs:#main-start': /* glsl */ `
76
+ if (terrain.mode == TERRAIN_MODE_SKIP) {
55
77
  gl_Position = vec4(0.0);
56
78
  return;
57
79
  }
58
80
  `,
59
- 'vs:DECKGL_FILTER_GL_POSITION': glsl`
81
+ 'vs:DECKGL_FILTER_GL_POSITION': /* glsl */ `
60
82
  commonPos = geometry.position.xyz;
61
- if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
62
- vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
83
+ if (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
84
+ vec2 texCoords = (commonPos.xy - terrain.bounds.xy) / terrain.bounds.zw;
63
85
  position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);
64
- commonPos.z += project_uCommonOrigin.z;
86
+ commonPos.z += project.commonOrigin.z;
65
87
  }
66
- if (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
88
+ if (terrain.mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
67
89
  vec3 anchor = geometry.worldPosition;
68
90
  anchor.z = 0.0;
69
91
  vec3 anchorCommon = project_position(anchor);
70
- vec2 texCoords = (anchorCommon.xy - terrain_bounds.xy) / terrain_bounds.zw;
92
+ vec2 texCoords = (anchorCommon.xy - terrain.bounds.xy) / terrain.bounds.zw;
71
93
  if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {
72
94
  float terrainZ = texture(terrain_map, texCoords).r;
73
95
  geometry.position.z += terrainZ;
@@ -75,24 +97,17 @@ if (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
75
97
  }
76
98
  }
77
99
  `,
78
- 'fs:#decl':
79
- glsl`
80
- uniform float terrain_mode;
81
- uniform sampler2D terrain_map;
82
- uniform vec4 terrain_bounds;
83
- in vec3 commonPos;
84
- ` + TERRAIN_MODE_CONSTANTS,
85
- 'fs:#main-start': glsl`
86
- if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
100
+ 'fs:#main-start': /* glsl */ `
101
+ if (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
87
102
  fragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);
88
103
  return;
89
104
  }
90
105
  `,
91
- 'fs:DECKGL_FILTER_COLOR': glsl`
92
- if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY)) {
93
- vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
106
+ 'fs:DECKGL_FILTER_COLOR': /* glsl */ `
107
+ if ((terrain.mode == TERRAIN_MODE_USE_COVER) || (terrain.mode == TERRAIN_MODE_USE_COVER_ONLY)) {
108
+ vec2 texCoords = (commonPos.xy - terrain.bounds.xy) / terrain.bounds.zw;
94
109
  vec4 pixel = texture(terrain_map, texCoords);
95
- if (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY) {
110
+ if (terrain.mode == TERRAIN_MODE_USE_COVER_ONLY) {
96
111
  color = pixel;
97
112
  } else {
98
113
  // pixel is premultiplied
@@ -103,7 +118,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
103
118
  `
104
119
  },
105
120
  // eslint-disable-next-line complexity
106
- getUniforms: (opts: Partial<TerrainModuleSettings> = {}, uniforms) => {
121
+ getUniforms: (opts: Partial<TerrainModuleProps> = {}) => {
107
122
  if ('dummyHeightMap' in opts) {
108
123
  const {
109
124
  drawToTerrainHeightMap,
@@ -114,8 +129,8 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
114
129
  useTerrainHeightMap,
115
130
  terrainSkipRender
116
131
  } = opts;
117
- // @ts-expect-error stricter luma gl types
118
- const {project_uCommonOrigin} = uniforms;
132
+ const projectUniforms = project.getUniforms(opts.project) as ProjectUniforms;
133
+ const {commonOrigin} = projectUniforms;
119
134
 
120
135
  let mode: number = terrainSkipRender ? TERRAIN_MODE.SKIP : TERRAIN_MODE.NONE;
121
136
  // height map if case USE_HEIGHT_MAP, terrain cover if USE_COVER, otherwise empty
@@ -131,12 +146,11 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
131
146
  bounds = heightMapBounds!;
132
147
  } else if (terrainCover) {
133
148
  // This is a terrain layer
134
- const isPicking = opts.picking?.isActive;
135
- const fbo = isPicking
149
+ const fbo = opts.isPicking
136
150
  ? terrainCover.getPickingFramebuffer()
137
151
  : terrainCover.getRenderFramebuffer();
138
152
  sampler = fbo?.colorAttachments[0].texture;
139
- if (isPicking) {
153
+ if (opts.isPicking) {
140
154
  // Never render the layer itself in picking pass
141
155
  mode = TERRAIN_MODE.SKIP;
142
156
  }
@@ -150,19 +164,23 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
150
164
 
151
165
  /* eslint-disable camelcase */
152
166
  return {
153
- terrain_mode: mode,
167
+ mode,
154
168
  terrain_map: sampler,
155
169
  // Convert bounds to the common space, as [minX, minY, width, height]
156
- terrain_bounds: bounds
170
+ bounds: bounds
157
171
  ? [
158
- bounds[0] - project_uCommonOrigin[0],
159
- bounds[1] - project_uCommonOrigin[1],
172
+ bounds[0] - commonOrigin[0],
173
+ bounds[1] - commonOrigin[1],
160
174
  bounds[2] - bounds[0],
161
175
  bounds[3] - bounds[1]
162
176
  ]
163
177
  : [0, 0, 0, 0]
164
178
  };
165
179
  }
166
- return null;
180
+ return {};
181
+ },
182
+ uniformTypes: {
183
+ mode: 'f32',
184
+ bounds: 'vec4<f32>'
167
185
  }
168
- } as ShaderModule<TerrainModuleSettings>;
186
+ } as const satisfies ShaderModule<TerrainModuleProps, TerrainModuleUniforms, TerrainModuleBindings>;
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {Framebuffer} from '@luma.gl/core';
2
6
 
3
7
  import type {Layer, Viewport} from '@deck.gl/core';
@@ -1,7 +1,11 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {Texture} from '@luma.gl/core';
2
6
  import {log} from '@deck.gl/core';
3
7
 
4
- import {terrainModule, TerrainModuleSettings} from './shader-module';
8
+ import {terrainModule, TerrainModuleProps} from './shader-module';
5
9
  import {TerrainCover} from './terrain-cover';
6
10
  import {TerrainPass} from './terrain-pass';
7
11
  import {TerrainPickingPass, TerrainPickingPassRenderOptions} from './terrain-picking-pass';
@@ -43,7 +47,6 @@ export class TerrainEffect implements Effect {
43
47
  log.warn('Terrain offset mode is not supported by this browser')();
44
48
  }
45
49
 
46
- // @ts-expect-error stricter luma gl types
47
50
  deck._addDefaultShaderModule(terrainModule);
48
51
  }
49
52
 
@@ -83,16 +86,23 @@ export class TerrainEffect implements Effect {
83
86
  this._updateTerrainCovers(terrainLayers, drapeLayers, viewport, opts);
84
87
  }
85
88
 
86
- getModuleParameters(layer: Layer): Omit<TerrainModuleSettings, 'picking'> {
89
+ getShaderModuleProps(
90
+ layer: Layer,
91
+ otherShaderModuleProps: Record<string, any>
92
+ ): {terrain: TerrainModuleProps} {
87
93
  const {terrainDrawMode} = layer.state;
88
94
 
89
95
  return {
90
- heightMap: this.heightMap?.getRenderFramebuffer()?.colorAttachments[0].texture || null,
91
- heightMapBounds: this.heightMap?.bounds,
92
- dummyHeightMap: this.dummyHeightMap!,
93
- terrainCover: this.isDrapingEnabled ? this.terrainCovers.get(layer.id) : null,
94
- useTerrainHeightMap: terrainDrawMode === 'offset',
95
- terrainSkipRender: terrainDrawMode === 'drape' || !layer.props.operation.includes('draw')
96
+ terrain: {
97
+ project: otherShaderModuleProps.project,
98
+ isPicking: this.isPicking,
99
+ heightMap: this.heightMap?.getRenderFramebuffer()?.colorAttachments[0].texture || null,
100
+ heightMapBounds: this.heightMap?.bounds,
101
+ dummyHeightMap: this.dummyHeightMap!,
102
+ terrainCover: this.isDrapingEnabled ? this.terrainCovers.get(layer.id) : null,
103
+ useTerrainHeightMap: terrainDrawMode === 'offset',
104
+ terrainSkipRender: terrainDrawMode === 'drape' || !layer.props.operation.includes('draw')
105
+ }
96
106
  };
97
107
  }
98
108
 
@@ -112,7 +122,6 @@ export class TerrainEffect implements Effect {
112
122
  }
113
123
  this.terrainCovers.clear();
114
124
 
115
- // @ts-expect-error stricter luma gl types
116
125
  deck._removeDefaultShaderModule(terrainModule);
117
126
  }
118
127
 
@@ -130,11 +139,15 @@ export class TerrainEffect implements Effect {
130
139
  this.terrainPass.renderHeightMap(this.heightMap, {
131
140
  ...opts,
132
141
  layers: terrainLayers,
133
- moduleParameters: {
134
- heightMapBounds: this.heightMap.bounds,
135
- dummyHeightMap: this.dummyHeightMap,
136
- devicePixelRatio: 1,
137
- drawToTerrainHeightMap: true
142
+ shaderModuleProps: {
143
+ terrain: {
144
+ heightMapBounds: this.heightMap.bounds,
145
+ dummyHeightMap: this.dummyHeightMap,
146
+ drawToTerrainHeightMap: true
147
+ },
148
+ project: {
149
+ devicePixelRatio: 1
150
+ }
138
151
  }
139
152
  });
140
153
  }
@@ -188,10 +201,14 @@ export class TerrainEffect implements Effect {
188
201
  renderPass.renderTerrainCover(terrainCover, {
189
202
  ...opts,
190
203
  layers: drapeLayers,
191
- moduleParameters: {
192
- dummyHeightMap: this.dummyHeightMap,
193
- terrainSkipRender: false,
194
- devicePixelRatio: 1
204
+ shaderModuleProps: {
205
+ terrain: {
206
+ dummyHeightMap: this.dummyHeightMap,
207
+ terrainSkipRender: false
208
+ },
209
+ project: {
210
+ devicePixelRatio: 1
211
+ }
195
212
  }
196
213
  });
197
214
 
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {LayerExtension, UpdateParameters} from '@deck.gl/core';
2
6
  import {TerrainEffect} from './terrain-effect';
3
7
  import {terrainModule} from './shader-module';
@@ -1,4 +1,8 @@
1
- import {RenderPipelineParameters} from '@luma.gl/core';
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {Parameters, RenderPipelineParameters} from '@luma.gl/core';
2
6
  import {Layer, Viewport, _LayersPass as LayersPass, LayersPassRenderOptions} from '@deck.gl/core';
3
7
  import type {HeightMapBuilder} from './height-map-builder';
4
8
  import type {TerrainCover} from './terrain-cover';
@@ -75,12 +79,24 @@ export class TerrainPass extends LayersPass {
75
79
  });
76
80
  }
77
81
 
78
- protected getLayerParameters(layer: Layer<{}>, layerIndex: number, viewport: Viewport) {
82
+ protected getLayerParameters(
83
+ layer: Layer<{}>,
84
+ layerIndex: number,
85
+ viewport: Viewport
86
+ ): Parameters {
79
87
  return {
80
88
  ...layer.props.parameters,
81
89
  blend: true,
82
- depthTest: false,
90
+ depthCompare: 'always',
83
91
  ...(layer.props.operation.includes('terrain') && TERRAIN_BLENDING)
84
92
  };
85
93
  }
94
+
95
+ getShaderModuleProps(layer: Layer, effects: any, otherShaderModuleProps: Record<string, any>) {
96
+ return {
97
+ terrain: {
98
+ project: otherShaderModuleProps.project
99
+ }
100
+ };
101
+ }
86
102
  }
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {
2
6
  Layer,
3
7
  Viewport,
@@ -5,6 +9,7 @@ import {
5
9
  _PickLayersPass as PickLayersPass
6
10
  } from '@deck.gl/core';
7
11
  import type {TerrainCover} from './terrain-cover';
12
+ import {Parameters} from '@luma.gl/core';
8
13
 
9
14
  export type TerrainPickingPassRenderOptions = LayersPassRenderOptions & {
10
15
  pickZ: boolean;
@@ -68,7 +73,7 @@ export class TerrainPickingPass extends PickLayersPass {
68
73
  });
69
74
  }
70
75
 
71
- protected getLayerParameters(layer: Layer, layerIndex: number, viewport: Viewport): any {
76
+ protected getLayerParameters(layer: Layer, layerIndex: number, viewport: Viewport): Parameters {
72
77
  let parameters: any;
73
78
  if (this.drawParameters[layer.id]) {
74
79
  parameters = this.drawParameters[layer.id];
@@ -76,6 +81,14 @@ export class TerrainPickingPass extends PickLayersPass {
76
81
  parameters = super.getLayerParameters(layer, layerIndex, viewport);
77
82
  parameters.blend = true;
78
83
  }
79
- return {...parameters, depthTest: false};
84
+ return {...parameters, depthCompare: 'always'};
85
+ }
86
+
87
+ getShaderModuleProps(layer: Layer, effects: any, otherShaderModuleProps: Record<string, any>) {
88
+ return {
89
+ terrain: {
90
+ project: otherShaderModuleProps.project
91
+ }
92
+ };
80
93
  }
81
94
  }
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import type {Device} from '@luma.gl/core';
2
6
  import {GL} from '@luma.gl/constants';
3
7
 
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  /* global document */
2
6
 
3
7
  import {Framebuffer} from '@luma.gl/core';
@@ -1,3 +1,7 @@
1
+ // deck.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
1
5
  import {WebMercatorViewport, OrthographicViewport} from '@deck.gl/core';
2
6
  import type {Layer, Viewport} from '@deck.gl/core';
3
7
 
@@ -1,6 +0,0 @@
1
- /**
2
- * Marks GLSL shaders for syntax highlighting: glsl`...`
3
- * Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
4
- */
5
- export declare const glsl: (s: TemplateStringsArray) => string;
6
- //# sourceMappingURL=syntax-tags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"syntax-tags.d.ts","sourceRoot":"","sources":["../../src/utils/syntax-tags.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,IAAI,MAAO,oBAAoB,WAAW,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Marks GLSL shaders for syntax highlighting: glsl`...`
3
- * Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
4
- */
5
- export const glsl = (s) => `${s}`;
@@ -1,5 +0,0 @@
1
- /**
2
- * Marks GLSL shaders for syntax highlighting: glsl`...`
3
- * Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
4
- */
5
- export const glsl = (s: TemplateStringsArray) => `${s}`;