@deck.gl/extensions 9.0.12 → 9.0.14

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 (30) hide show
  1. package/dist/brushing/brushing-extension.d.ts.map +1 -1
  2. package/dist/brushing/brushing-extension.js +2 -9
  3. package/dist/brushing/shader-module.d.ts.map +1 -1
  4. package/dist/brushing/shader-module.js +0 -8
  5. package/dist/collision-filter/collision-filter-extension.d.ts.map +1 -1
  6. package/dist/collision-filter/collision-filter-extension.js +2 -5
  7. package/dist/collision-filter/shader-module.d.ts.map +1 -1
  8. package/dist/collision-filter/shader-module.js +0 -8
  9. package/dist/data-filter/data-filter-extension.d.ts.map +1 -1
  10. package/dist/data-filter/data-filter-extension.js +4 -18
  11. package/dist/data-filter/shader-module.d.ts +0 -12
  12. package/dist/data-filter/shader-module.d.ts.map +1 -1
  13. package/dist/data-filter/shader-module.js +10 -22
  14. package/dist/dist.dev.js +30 -114
  15. package/dist/fill-style/fill-style-extension.d.ts.map +1 -1
  16. package/dist/fill-style/fill-style-extension.js +6 -27
  17. package/dist/fill-style/shader-module.d.ts.map +1 -1
  18. package/dist/fill-style/shader-module.js +6 -15
  19. package/dist/index.cjs +30 -112
  20. package/dist/index.cjs.map +2 -2
  21. package/dist.min.js +36 -73
  22. package/package.json +2 -2
  23. package/src/brushing/brushing-extension.ts +2 -9
  24. package/src/brushing/shader-module.ts +0 -8
  25. package/src/collision-filter/collision-filter-extension.ts +2 -5
  26. package/src/collision-filter/shader-module.ts +0 -8
  27. package/src/data-filter/data-filter-extension.ts +4 -18
  28. package/src/data-filter/shader-module.ts +10 -37
  29. package/src/fill-style/fill-style-extension.ts +6 -27
  30. package/src/fill-style/shader-module.ts +6 -16
package/dist/index.cjs CHANGED
@@ -43,11 +43,7 @@ uniform bool brushing_enabled;
43
43
  uniform int brushing_target;
44
44
  uniform vec2 brushing_mousePos;
45
45
  uniform float brushing_radius;
46
- #ifdef NON_INSTANCED_MODEL
47
46
  in vec2 brushingTargets;
48
- #else
49
- in vec2 instanceBrushingTargets;
50
- #endif
51
47
  out float brushing_isVisible;
52
48
  bool brushing_isPointInRange(vec2 position) {
53
49
  if (!brushing_enabled) {
@@ -87,11 +83,7 @@ brushingTarget = geometry.worldPosition.xy;
87
83
  } else if (brushing_target == 1) {
88
84
  brushingTarget = geometry.worldPositionAlt.xy;
89
85
  } else {
90
- #ifdef NON_INSTANCED_MODEL
91
86
  brushingTarget = brushingTargets;
92
- #else
93
- brushingTarget = instanceBrushingTargets;
94
- #endif
95
87
  }
96
88
  bool visible;
97
89
  if (brushing_target == 3) {
@@ -146,15 +138,8 @@ var _BrushingExtension = class extends import_core2.LayerExtension {
146
138
  attributeManager.add({
147
139
  brushingTargets: {
148
140
  size: 2,
149
- accessor: "getBrushingTarget",
150
- shaderAttributes: {
151
- brushingTargets: {
152
- divisor: 0
153
- },
154
- instanceBrushingTargets: {
155
- divisor: 1
156
- }
157
- }
141
+ stepMode: "dynamic",
142
+ accessor: "getBrushingTarget"
158
143
  }
159
144
  });
160
145
  }
@@ -202,27 +187,15 @@ uniform DATAFILTER_TYPE filter_min;
202
187
  uniform DATAFILTER_TYPE filter_softMin;
203
188
  uniform DATAFILTER_TYPE filter_softMax;
204
189
  uniform DATAFILTER_TYPE filter_max;
205
- #ifdef NON_INSTANCED_MODEL
206
- #define DATAFILTER_ATTRIB filterValues
207
- #define DATAFILTER_ATTRIB_64LOW filterValues64Low
208
- #else
209
- #define DATAFILTER_ATTRIB instanceFilterValues
210
- #define DATAFILTER_ATTRIB_64LOW instanceFilterValues64Low
211
- #endif
212
- in DATAFILTER_TYPE DATAFILTER_ATTRIB;
190
+ in DATAFILTER_TYPE filterValues;
213
191
  #ifdef DATAFILTER_DOUBLE
214
- in DATAFILTER_TYPE DATAFILTER_ATTRIB_64LOW;
192
+ in DATAFILTER_TYPE filterValues64Low;
215
193
  uniform DATAFILTER_TYPE filter_min64High;
216
194
  uniform DATAFILTER_TYPE filter_max64High;
217
195
  #endif
218
196
  #endif
219
197
  #ifdef DATACATEGORY_TYPE
220
- #ifdef NON_INSTANCED_MODEL
221
- #define DATACATEGORY_ATTRIB filterCategoryValues
222
- #else
223
- #define DATACATEGORY_ATTRIB instanceFilterCategoryValues
224
- #endif
225
- in DATACATEGORY_TYPE DATACATEGORY_ATTRIB;
198
+ in DATACATEGORY_TYPE filterCategoryValues;
226
199
  #endif
227
200
  out float dataFilter_value;
228
201
  float dataFilter_reduceValue(float value) {
@@ -258,7 +231,7 @@ step(filter_min, valueFromMin) * step(valueFromMax, filter_max)
258
231
  }
259
232
  }
260
233
  #endif
261
- #ifdef DATACATEGORY_ATTRIB
234
+ #ifdef DATACATEGORY_TYPE
262
235
  void dataFilter_setCategoryValue(DATACATEGORY_TYPE category) {
263
236
  #if DATACATEGORY_CHANNELS == 1
264
237
  int dataFilter_masks = filter_categoryBitMask[int(category / 32.0)];
@@ -340,18 +313,18 @@ var inject2 = {
340
313
  "vs:#main-start": `
341
314
  dataFilter_value = 1.0;
342
315
  if (filter_enabled) {
343
- #ifdef DATAFILTER_ATTRIB
316
+ #ifdef DATAFILTER_TYPE
344
317
  #ifdef DATAFILTER_DOUBLE
345
318
  dataFilter_setValue(
346
- DATAFILTER_ATTRIB - filter_min64High + DATAFILTER_ATTRIB_64LOW,
347
- DATAFILTER_ATTRIB - filter_max64High + DATAFILTER_ATTRIB_64LOW
319
+ filterValues - filter_min64High + filterValues64Low,
320
+ filterValues - filter_max64High + filterValues64Low
348
321
  );
349
322
  #else
350
- dataFilter_setValue(DATAFILTER_ATTRIB, DATAFILTER_ATTRIB);
323
+ dataFilter_setValue(filterValues, filterValues);
351
324
  #endif
352
325
  #endif
353
- #ifdef DATACATEGORY_ATTRIB
354
- dataFilter_setCategoryValue(DATACATEGORY_ATTRIB);
326
+ #ifdef DATACATEGORY_TYPE
327
+ dataFilter_setCategoryValue(filterCategoryValues);
355
328
  #endif
356
329
  }
357
330
  `,
@@ -536,15 +509,8 @@ var _DataFilterExtension = class extends import_core3.LayerExtension {
536
509
  filterValues: {
537
510
  size: filterSize,
538
511
  type: fp642 ? "float64" : "float32",
539
- accessor: "getFilterValue",
540
- shaderAttributes: {
541
- filterValues: {
542
- divisor: 0
543
- },
544
- instanceFilterValues: {
545
- divisor: 1
546
- }
547
- }
512
+ stepMode: "dynamic",
513
+ accessor: "getFilterValue"
548
514
  }
549
515
  });
550
516
  }
@@ -552,16 +518,9 @@ var _DataFilterExtension = class extends import_core3.LayerExtension {
552
518
  attributeManager.add({
553
519
  filterCategoryValues: {
554
520
  size: categorySize,
521
+ stepMode: "dynamic",
555
522
  accessor: "getFilterCategory",
556
- transform: categorySize === 1 ? (d) => extension._getCategoryKey.call(this, d, 0) : (d) => d.map((x, i) => extension._getCategoryKey.call(this, x, i)),
557
- shaderAttributes: {
558
- filterCategoryValues: {
559
- divisor: 0
560
- },
561
- instanceFilterCategoryValues: {
562
- divisor: 1
563
- }
564
- }
523
+ transform: categorySize === 1 ? (d) => extension._getCategoryKey.call(this, d, 0) : (d) => d.map((x, i) => extension._getCategoryKey.call(this, x, i))
565
524
  }
566
525
  });
567
526
  }
@@ -992,18 +951,9 @@ var import_core9 = require("@deck.gl/core");
992
951
  // dist/fill-style/shader-module.js
993
952
  var import_core8 = require("@deck.gl/core");
994
953
  var patternVs = `
995
- #ifdef NON_INSTANCED_MODEL
996
- #define FILL_PATTERN_FRAME_ATTRIB fillPatternFrames
997
- #define FILL_PATTERN_SCALE_ATTRIB fillPatternScales
998
- #define FILL_PATTERN_OFFSET_ATTRIB fillPatternOffsets
999
- #else
1000
- #define FILL_PATTERN_FRAME_ATTRIB instanceFillPatternFrames
1001
- #define FILL_PATTERN_SCALE_ATTRIB instanceFillPatternScales
1002
- #define FILL_PATTERN_OFFSET_ATTRIB instanceFillPatternOffsets
1003
- #endif
1004
- in vec4 FILL_PATTERN_FRAME_ATTRIB;
1005
- in float FILL_PATTERN_SCALE_ATTRIB;
1006
- in vec2 FILL_PATTERN_OFFSET_ATTRIB;
954
+ in vec4 fillPatternFrames;
955
+ in float fillPatternScales;
956
+ in vec2 fillPatternOffsets;
1007
957
  uniform bool fill_patternEnabled;
1008
958
  uniform vec2 fill_patternTextureSize;
1009
959
  out vec2 fill_uv;
@@ -1027,9 +977,9 @@ fill_uv = geometry.position.xy;
1027
977
  `,
1028
978
  "vs:DECKGL_FILTER_COLOR": `
1029
979
  if (fill_patternEnabled) {
1030
- fill_patternBounds = FILL_PATTERN_FRAME_ATTRIB / vec4(fill_patternTextureSize, fill_patternTextureSize);
1031
- fill_patternPlacement.xy = FILL_PATTERN_OFFSET_ATTRIB;
1032
- fill_patternPlacement.zw = FILL_PATTERN_SCALE_ATTRIB * FILL_PATTERN_FRAME_ATTRIB.zw;
980
+ fill_patternBounds = fillPatternFrames / vec4(fill_patternTextureSize, fill_patternTextureSize);
981
+ fill_patternPlacement.xy = fillPatternOffsets;
982
+ fill_patternPlacement.zw = fillPatternScales * fillPatternFrames.zw;
1033
983
  }
1034
984
  `,
1035
985
  "fs:DECKGL_FILTER_COLOR": `
@@ -1121,41 +1071,20 @@ var _FillStyleExtension = class extends import_core9.LayerExtension {
1121
1071
  attributeManager.add({
1122
1072
  fillPatternFrames: {
1123
1073
  size: 4,
1074
+ stepMode: "dynamic",
1124
1075
  accessor: "getFillPattern",
1125
- transform: extension.getPatternFrame.bind(this),
1126
- shaderAttributes: {
1127
- fillPatternFrames: {
1128
- divisor: 0
1129
- },
1130
- instanceFillPatternFrames: {
1131
- divisor: 1
1132
- }
1133
- }
1076
+ transform: extension.getPatternFrame.bind(this)
1134
1077
  },
1135
1078
  fillPatternScales: {
1136
1079
  size: 1,
1080
+ stepMode: "dynamic",
1137
1081
  accessor: "getFillPatternScale",
1138
- defaultValue: 1,
1139
- shaderAttributes: {
1140
- fillPatternScales: {
1141
- divisor: 0
1142
- },
1143
- instanceFillPatternScales: {
1144
- divisor: 1
1145
- }
1146
- }
1082
+ defaultValue: 1
1147
1083
  },
1148
1084
  fillPatternOffsets: {
1149
1085
  size: 2,
1150
- accessor: "getFillPatternOffset",
1151
- shaderAttributes: {
1152
- fillPatternOffsets: {
1153
- divisor: 0
1154
- },
1155
- instanceFillPatternOffsets: {
1156
- divisor: 1
1157
- }
1158
- }
1086
+ stepMode: "dynamic",
1087
+ accessor: "getFillPatternOffset"
1159
1088
  }
1160
1089
  });
1161
1090
  }
@@ -1295,11 +1224,7 @@ var import_core15 = require("@deck.gl/core");
1295
1224
  // dist/collision-filter/shader-module.js
1296
1225
  var import_core11 = require("@deck.gl/core");
1297
1226
  var vs3 = `
1298
- #ifdef NON_INSTANCED_MODEL
1299
1227
  in float collisionPriorities;
1300
- #else
1301
- in float instanceCollisionPriorities;
1302
- #endif
1303
1228
  uniform sampler2D collision_texture;
1304
1229
  uniform bool collision_sort;
1305
1230
  uniform bool collision_enabled;
@@ -1340,11 +1265,7 @@ float collision_fade = 1.0;
1340
1265
  `,
1341
1266
  "vs:DECKGL_FILTER_GL_POSITION": `
1342
1267
  if (collision_sort) {
1343
- #ifdef NON_INSTANCED_MODEL
1344
1268
  float collisionPriority = collisionPriorities;
1345
- #else
1346
- float collisionPriority = instanceCollisionPriorities;
1347
- #endif
1348
1269
  position.z = -0.001 * collisionPriority * position.w;
1349
1270
  }
1350
1271
  if (collision_enabled) {
@@ -1602,11 +1523,8 @@ var _CollisionFilterExtension = class extends import_core15.LayerExtension {
1602
1523
  attributeManager.add({
1603
1524
  collisionPriorities: {
1604
1525
  size: 1,
1605
- accessor: "getCollisionPriority",
1606
- shaderAttributes: {
1607
- collisionPriorities: { divisor: 0 },
1608
- instanceCollisionPriorities: { divisor: 1 }
1609
- }
1526
+ stepMode: "dynamic",
1527
+ accessor: "getCollisionPriority"
1610
1528
  }
1611
1529
  });
1612
1530
  }