@deck.gl/extensions 9.0.0-beta.10 → 9.0.0-beta.11
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/collision-filter/collision-filter-effect.d.ts +4 -2
- package/dist/collision-filter/collision-filter-effect.d.ts.map +1 -1
- package/dist/collision-filter/collision-filter-effect.js +10 -9
- package/dist/collision-filter/collision-filter-pass.d.ts +3 -2
- package/dist/collision-filter/collision-filter-pass.d.ts.map +1 -1
- package/dist/collision-filter/collision-filter-pass.js +5 -7
- package/dist/data-filter/data-filter-extension.d.ts +5 -5
- package/dist/data-filter/data-filter-extension.d.ts.map +1 -1
- package/dist/data-filter/data-filter-extension.js +45 -38
- package/dist/data-filter/shader-module.d.ts +30 -0
- package/dist/data-filter/shader-module.d.ts.map +1 -1
- package/dist/data-filter/shader-module.js +40 -20
- package/dist/dist.dev.js +571 -535
- package/dist/index.cjs +517 -478
- package/dist/index.cjs.map +4 -4
- package/dist/mask/mask-effect.d.ts +5 -4
- package/dist/mask/mask-effect.d.ts.map +1 -1
- package/dist/mask/mask-effect.js +9 -11
- package/dist/mask/mask-pass.d.ts +45 -3
- package/dist/mask/mask-pass.d.ts.map +1 -1
- package/dist/mask/mask-pass.js +17 -9
- package/dist/path-style/path-style-extension.d.ts.map +1 -1
- package/dist/path-style/path-style-extension.js +1 -0
- package/dist/terrain/terrain-cover.d.ts.map +1 -1
- package/dist/terrain/terrain-cover.js +2 -1
- package/dist/terrain/terrain-effect.d.ts +4 -5
- package/dist/terrain/terrain-effect.d.ts.map +1 -1
- package/dist/terrain/terrain-effect.js +6 -16
- package/dist/terrain/terrain-pass.d.ts +42 -0
- package/dist/terrain/terrain-pass.d.ts.map +1 -1
- package/dist/terrain/terrain-pass.js +24 -16
- package/dist/terrain/terrain-picking-pass.d.ts.map +1 -1
- package/dist/terrain/terrain-picking-pass.js +9 -8
- package/dist/terrain/utils.d.ts +1 -0
- package/dist/terrain/utils.d.ts.map +1 -1
- package/dist/terrain/utils.js +10 -6
- package/dist.min.js +63 -40
- package/package.json +6 -6
- package/src/collision-filter/collision-filter-effect.ts +23 -23
- package/src/collision-filter/collision-filter-pass.ts +7 -11
- package/src/data-filter/data-filter-extension.ts +57 -49
- package/src/data-filter/shader-module.ts +109 -43
- package/src/mask/mask-effect.ts +30 -19
- package/src/mask/mask-pass.ts +22 -16
- package/src/path-style/path-style-extension.ts +1 -0
- package/src/terrain/terrain-cover.ts +2 -1
- package/src/terrain/terrain-effect.ts +8 -19
- package/src/terrain/terrain-pass.ts +37 -34
- package/src/terrain/terrain-picking-pass.ts +19 -23
- package/src/terrain/utils.ts +12 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Effect, PreRenderOptions, CoordinateSystem } from '@deck.gl/core';
|
|
2
|
-
import type {
|
|
1
|
+
import { Effect, EffectContext, PreRenderOptions, CoordinateSystem } from '@deck.gl/core';
|
|
2
|
+
import type { Texture } from '@luma.gl/core';
|
|
3
3
|
import { Bounds } from "../utils/projection-utils.js";
|
|
4
4
|
type Mask = {
|
|
5
5
|
/** The channel index */
|
|
6
|
-
index:
|
|
6
|
+
index: 0 | 1 | 2 | 3;
|
|
7
7
|
bounds: Bounds;
|
|
8
8
|
coordinateOrigin: [number, number, number];
|
|
9
9
|
coordinateSystem: CoordinateSystem;
|
|
@@ -22,7 +22,8 @@ export default class MaskEffect implements Effect {
|
|
|
22
22
|
private maskPass?;
|
|
23
23
|
private maskMap?;
|
|
24
24
|
private lastViewport?;
|
|
25
|
-
|
|
25
|
+
setup({ device }: EffectContext): void;
|
|
26
|
+
preRender({ layers, layerFilter, viewports, onViewportActive, views, isPicking }: PreRenderOptions): MaskPreRenderStats;
|
|
26
27
|
private _renderChannel;
|
|
27
28
|
/**
|
|
28
29
|
* Find a channel to render each mask into
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-effect.d.ts","sourceRoot":"","sources":["../../src/mask/mask-effect.ts"],"names":[],"mappings":"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AAO,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;KAC3C;IAOD,OAAO,IAAI,IAAI;CAgBhB"}
|
package/dist/mask/mask-effect.js
CHANGED
|
@@ -12,14 +12,16 @@ export default class MaskEffect {
|
|
|
12
12
|
this.channels = [];
|
|
13
13
|
this.masks = null;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
setup({ device }) {
|
|
16
|
+
this.dummyMaskMap = device.createTexture({
|
|
17
|
+
width: 1,
|
|
18
|
+
height: 1
|
|
19
|
+
});
|
|
20
|
+
this.maskPass = new MaskPass(device, { id: 'default-mask' });
|
|
21
|
+
this.maskMap = this.maskPass.maskMap;
|
|
22
|
+
}
|
|
23
|
+
preRender({ layers, layerFilter, viewports, onViewportActive, views, isPicking }) {
|
|
16
24
|
let didRender = false;
|
|
17
|
-
if (!this.dummyMaskMap) {
|
|
18
|
-
this.dummyMaskMap = device.createTexture({
|
|
19
|
-
width: 1,
|
|
20
|
-
height: 1
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
25
|
if (isPicking) {
|
|
24
26
|
// Do not update on picking pass
|
|
25
27
|
return { didRender };
|
|
@@ -31,10 +33,6 @@ export default class MaskEffect {
|
|
|
31
33
|
return { didRender };
|
|
32
34
|
}
|
|
33
35
|
this.masks = {};
|
|
34
|
-
if (!this.maskPass) {
|
|
35
|
-
this.maskPass = new MaskPass(device, { id: 'default-mask' });
|
|
36
|
-
this.maskMap = this.maskPass.maskMap;
|
|
37
|
-
}
|
|
38
36
|
// Map layers to channels
|
|
39
37
|
const channelMap = this._sortMaskChannels(maskLayers);
|
|
40
38
|
// TODO - support multiple views
|
package/dist/mask/mask-pass.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Device, Framebuffer, Texture } from '@luma.gl/core';
|
|
2
|
-
import { _LayersPass as LayersPass, LayersPassRenderOptions } from '@deck.gl/core';
|
|
2
|
+
import { Layer, _LayersPass as LayersPass, LayersPassRenderOptions, Viewport } from '@deck.gl/core';
|
|
3
3
|
type MaskPassRenderOptions = LayersPassRenderOptions & {
|
|
4
4
|
/** The channel to render into, 0:red, 1:green, 2:blue, 3:alpha */
|
|
5
|
-
channel:
|
|
5
|
+
channel: 0 | 1 | 2 | 3;
|
|
6
6
|
};
|
|
7
7
|
export default class MaskPass extends LayersPass {
|
|
8
8
|
maskMap: Texture;
|
|
@@ -11,7 +11,49 @@ export default class MaskPass extends LayersPass {
|
|
|
11
11
|
id: string;
|
|
12
12
|
mapSize?: number;
|
|
13
13
|
});
|
|
14
|
-
render(options: MaskPassRenderOptions):
|
|
14
|
+
render(options: MaskPassRenderOptions): void;
|
|
15
|
+
protected getLayerParameters(layer: Layer<{}>, layerIndex: number, viewport: Viewport): {
|
|
16
|
+
cullMode?: import("@luma.gl/core").CullMode | undefined;
|
|
17
|
+
frontFace?: import("@luma.gl/core").FrontFace | undefined;
|
|
18
|
+
depthBias?: number | undefined;
|
|
19
|
+
depthBiasSlopeScale?: number | undefined;
|
|
20
|
+
depthBiasClamp?: number | undefined;
|
|
21
|
+
unclippedDepth?: boolean | undefined;
|
|
22
|
+
provokingVertex?: "first" | "last" | undefined;
|
|
23
|
+
polygonMode?: "fill" | "line" | undefined;
|
|
24
|
+
polygonOffsetLine?: boolean | undefined;
|
|
25
|
+
clipDistance0?: boolean | undefined;
|
|
26
|
+
clipDistance1?: boolean | undefined;
|
|
27
|
+
clipDistance2?: boolean | undefined;
|
|
28
|
+
clipDistance3?: boolean | undefined;
|
|
29
|
+
clipDistance4?: boolean | undefined;
|
|
30
|
+
clipDistance5?: boolean | undefined;
|
|
31
|
+
clipDistance6?: boolean | undefined;
|
|
32
|
+
clipDistance7?: boolean | undefined;
|
|
33
|
+
topology?: import("@luma.gl/core").PrimitiveTopology | undefined;
|
|
34
|
+
stripIndexFormat?: import("@luma.gl/core").IndexFormat | undefined;
|
|
35
|
+
depthWriteEnabled?: boolean | undefined;
|
|
36
|
+
depthCompare?: import("@luma.gl/core").CompareFunction | undefined;
|
|
37
|
+
depthFormat?: import("@luma.gl/core").DepthStencilTextureFormat | undefined;
|
|
38
|
+
stencilReadMask?: number | undefined;
|
|
39
|
+
stencilWriteMask?: number | undefined;
|
|
40
|
+
stencilCompare?: import("@luma.gl/core").CompareFunction | undefined;
|
|
41
|
+
stencilPassOperation?: import("@luma.gl/core").StencilOperation | undefined;
|
|
42
|
+
stencilFailOperation?: import("@luma.gl/core").StencilOperation | undefined;
|
|
43
|
+
stencilDepthFailOperation?: import("@luma.gl/core").StencilOperation | undefined;
|
|
44
|
+
blendColorOperation?: import("@luma.gl/core").BlendOperation | undefined;
|
|
45
|
+
blendColorSrcFactor?: import("@luma.gl/core").BlendFactor | undefined;
|
|
46
|
+
blendColorDstFactor?: import("@luma.gl/core").BlendFactor | undefined;
|
|
47
|
+
blendAlphaOperation?: import("@luma.gl/core").BlendOperation | undefined;
|
|
48
|
+
blendAlphaSrcFactor?: import("@luma.gl/core").BlendFactor | undefined;
|
|
49
|
+
blendAlphaDstFactor?: import("@luma.gl/core").BlendFactor | undefined;
|
|
50
|
+
colorMask?: number | undefined;
|
|
51
|
+
sampleCount?: number | undefined;
|
|
52
|
+
sampleMask?: number | undefined;
|
|
53
|
+
sampleAlphaToCoverageEnabled?: boolean | undefined;
|
|
54
|
+
blend: boolean;
|
|
55
|
+
depthTest: boolean;
|
|
56
|
+
};
|
|
15
57
|
shouldDrawLayer(layer: any): any;
|
|
16
58
|
delete(): void;
|
|
17
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-pass.d.ts","sourceRoot":"","sources":["../../src/mask/mask-pass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"mask-pass.d.ts","sourceRoot":"","sources":["../../src/mask/mask-pass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,WAAW,EAA4B,OAAO,EAAC,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAC,KAAK,EAAE,WAAW,IAAI,UAAU,EAAE,uBAAuB,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAElG,KAAK,qBAAqB,GAAG,uBAAuB,GAAG;IACrD,kEAAkE;IAClE,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACxB,CAAC;AAWF,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,WAAW,CAAC;gBAEL,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IAyBjE,MAAM,CAAC,OAAO,EAAE,qBAAqB;IAMrC,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASrF,eAAe,CAAC,KAAK,KAAA;IAIrB,MAAM;CAIP"}
|
package/dist/mask/mask-pass.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { GL } from '@luma.gl/constants';
|
|
2
1
|
import { _LayersPass as LayersPass } from '@deck.gl/core';
|
|
2
|
+
const MASK_BLENDING = {
|
|
3
|
+
blendColorOperation: 'subtract',
|
|
4
|
+
blendColorSrcFactor: 'zero',
|
|
5
|
+
blendColorDstFactor: 'one',
|
|
6
|
+
blendAlphaOperation: 'subtract',
|
|
7
|
+
blendAlphaSrcFactor: 'zero',
|
|
8
|
+
blendAlphaDstFactor: 'one'
|
|
9
|
+
};
|
|
3
10
|
export default class MaskPass extends LayersPass {
|
|
4
11
|
constructor(device, props) {
|
|
5
12
|
super(device, props);
|
|
@@ -23,16 +30,17 @@ export default class MaskPass extends LayersPass {
|
|
|
23
30
|
});
|
|
24
31
|
}
|
|
25
32
|
render(options) {
|
|
26
|
-
const colorMask =
|
|
27
|
-
colorMask[options.channel] = true;
|
|
33
|
+
const colorMask = 2 ** options.channel;
|
|
28
34
|
const clearColor = [255, 255, 255, 255];
|
|
29
|
-
|
|
35
|
+
super.render({ ...options, clearColor, colorMask, target: this.fbo, pass: 'mask' });
|
|
36
|
+
}
|
|
37
|
+
getLayerParameters(layer, layerIndex, viewport) {
|
|
38
|
+
return {
|
|
39
|
+
...layer.props.parameters,
|
|
30
40
|
blend: true,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
depthTest: false
|
|
35
|
-
}, () => super.render({ ...options, clearColor, target: this.fbo, pass: 'mask' }));
|
|
41
|
+
depthTest: false,
|
|
42
|
+
...MASK_BLENDING
|
|
43
|
+
};
|
|
36
44
|
}
|
|
37
45
|
shouldDrawLayer(layer) {
|
|
38
46
|
return layer.props.operation.includes('mask');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-style-extension.d.ts","sourceRoot":"","sources":["../../src/path-style/path-style-extension.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAgC,MAAM,eAAe,CAAC;AAI5E,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAUnF,MAAM,MAAM,uBAAuB,CAAC,KAAK,GAAG,GAAG,IAAI;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AA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E,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"}
|
|
@@ -134,7 +134,8 @@ export class TerrainCover {
|
|
|
134
134
|
}
|
|
135
135
|
if (!this.pickingFbo) {
|
|
136
136
|
this.pickingFbo = createRenderTarget(this.targetLayer.context.device, {
|
|
137
|
-
id: `${this.id}-picking
|
|
137
|
+
id: `${this.id}-picking`,
|
|
138
|
+
interpolate: false
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
141
|
return this.pickingFbo;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Device } from '@luma.gl/core';
|
|
2
1
|
import { TerrainModuleSettings } from "./shader-module.js";
|
|
3
|
-
import type { Effect, PreRenderOptions, Layer } from '@deck.gl/core';
|
|
2
|
+
import type { Effect, EffectContext, PreRenderOptions, Layer } from '@deck.gl/core';
|
|
4
3
|
/** Class to manage terrain effect */
|
|
5
4
|
export declare class TerrainEffect implements Effect {
|
|
6
5
|
id: string;
|
|
@@ -18,10 +17,10 @@ export declare class TerrainEffect implements Effect {
|
|
|
18
17
|
private terrainPickingPass;
|
|
19
18
|
/** One texture for each primitive terrain layer, into which the draped layers render */
|
|
20
19
|
private terrainCovers;
|
|
21
|
-
|
|
22
|
-
preRender(
|
|
20
|
+
setup({ device, deck }: EffectContext): void;
|
|
21
|
+
preRender(opts: PreRenderOptions): void;
|
|
23
22
|
getModuleParameters(layer: Layer): Omit<TerrainModuleSettings, 'picking'>;
|
|
24
|
-
cleanup(): void;
|
|
23
|
+
cleanup({ deck }: EffectContext): void;
|
|
25
24
|
private _updateHeightMap;
|
|
26
25
|
private _updateTerrainCovers;
|
|
27
26
|
private _updateTerrainCover;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrain-effect.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-effect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"terrain-effect.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-effect.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,qBAAqB,EAAC,2BAAwB;AAMrE,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,EAAW,MAAM,eAAe,CAAC;AAE5F,qCAAqC;AACrC,qBAAa,aAAc,YAAW,MAAM;IAC1C,EAAE,SAAoB;IACtB,KAAK,OAAQ;IACb,YAAY,UAAQ;IAEpB,0CAA0C;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,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC;IAazE,OAAO,CAAC,EAAC,IAAI,EAAC,EAAE,aAAa,GAAG,IAAI;IAmBpC,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,mBAAmB;IAwC3B,OAAO,CAAC,mBAAmB;CAY5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { log
|
|
1
|
+
import { log } from '@deck.gl/core';
|
|
2
2
|
import { terrainModule } from "./shader-module.js";
|
|
3
3
|
import { TerrainCover } from "./terrain-cover.js";
|
|
4
4
|
import { TerrainPass } from "./terrain-pass.js";
|
|
@@ -17,7 +17,7 @@ export class TerrainEffect {
|
|
|
17
17
|
/** One texture for each primitive terrain layer, into which the draped layers render */
|
|
18
18
|
this.terrainCovers = new Map();
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
setup({ device, deck }) {
|
|
21
21
|
this.dummyHeightMap = device.createTexture({
|
|
22
22
|
width: 1,
|
|
23
23
|
height: 1,
|
|
@@ -31,19 +31,9 @@ export class TerrainEffect {
|
|
|
31
31
|
else {
|
|
32
32
|
log.warn('Terrain offset mode is not supported by this browser')();
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
deck._addDefaultShaderModule(terrainModule);
|
|
35
35
|
}
|
|
36
|
-
preRender(
|
|
37
|
-
if (!this.dummyHeightMap) {
|
|
38
|
-
// First time this effect is in use, initialize resources and register the shader module
|
|
39
|
-
this.initialize(device);
|
|
40
|
-
for (const layer of opts.layers) {
|
|
41
|
-
// Force the terrain layer (and its descendents) to rebuild their models with the new shader
|
|
42
|
-
if (layer.props.operation.includes('terrain')) {
|
|
43
|
-
layer.setChangeFlags({ extensionsChanged: true });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
36
|
+
preRender(opts) {
|
|
47
37
|
// @ts-expect-error pickZ only defined in picking pass
|
|
48
38
|
if (opts.pickZ) {
|
|
49
39
|
// Do not update if picking attributes
|
|
@@ -81,7 +71,7 @@ export class TerrainEffect {
|
|
|
81
71
|
terrainSkipRender: terrainDrawMode === 'drape' || !layer.props.operation.includes('draw')
|
|
82
72
|
};
|
|
83
73
|
}
|
|
84
|
-
cleanup() {
|
|
74
|
+
cleanup({ deck }) {
|
|
85
75
|
if (this.dummyHeightMap) {
|
|
86
76
|
this.dummyHeightMap.delete();
|
|
87
77
|
this.dummyHeightMap = undefined;
|
|
@@ -94,7 +84,7 @@ export class TerrainEffect {
|
|
|
94
84
|
terrainCover.delete();
|
|
95
85
|
}
|
|
96
86
|
this.terrainCovers.clear();
|
|
97
|
-
|
|
87
|
+
deck._removeDefaultShaderModule(terrainModule);
|
|
98
88
|
}
|
|
99
89
|
_updateHeightMap(terrainLayers, viewport, opts) {
|
|
100
90
|
if (!this.heightMap) {
|
|
@@ -7,5 +7,47 @@ export declare class TerrainPass extends LayersPass {
|
|
|
7
7
|
getRenderableLayers(viewport: Viewport, opts: TerrainPassRenderOptions): Layer[];
|
|
8
8
|
renderHeightMap(heightMap: HeightMapBuilder, opts: Partial<TerrainPassRenderOptions>): void;
|
|
9
9
|
renderTerrainCover(terrainCover: TerrainCover, opts: Partial<TerrainPassRenderOptions>): void;
|
|
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;
|
|
49
|
+
blend: boolean;
|
|
50
|
+
depthTest: boolean;
|
|
51
|
+
};
|
|
10
52
|
}
|
|
11
53
|
//# 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,KAAK,EAAE,QAAQ,EAAE,WAAW,IAAI,UAAU,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,EAAC,gBAAgB,EAAC,gCAA6B;AAC3D,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAElD,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"terrain-pass.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-pass.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,IAAI,UAAU,EAAE,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAClG,OAAO,KAAK,EAAC,gBAAgB,EAAC,gCAA6B;AAC3D,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAElD,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAC;AAW/D,6DAA6D;AAC7D,qBAAa,WAAY,SAAQ,UAAU;IACzC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,wBAAwB,GAAG,KAAK,EAAE;IAchF,eAAe,CAAC,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,CAAC,wBAAwB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQtF"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { GL } from '@luma.gl/constants';
|
|
2
1
|
import { _LayersPass as LayersPass } from '@deck.gl/core';
|
|
2
|
+
const TERRAIN_BLENDING = {
|
|
3
|
+
blendColorOperation: 'max',
|
|
4
|
+
blendColorSrcFactor: 'one',
|
|
5
|
+
blendColorDstFactor: 'one',
|
|
6
|
+
blendAlphaOperation: 'max',
|
|
7
|
+
blendAlphaSrcFactor: 'one',
|
|
8
|
+
blendAlphaDstFactor: 'one'
|
|
9
|
+
};
|
|
3
10
|
/** Renders textures used by the TerrainEffect render pass */
|
|
4
11
|
export class TerrainPass extends LayersPass {
|
|
5
12
|
getRenderableLayers(viewport, opts) {
|
|
@@ -22,20 +29,15 @@ export class TerrainPass extends LayersPass {
|
|
|
22
29
|
return;
|
|
23
30
|
}
|
|
24
31
|
target.resize(viewport);
|
|
25
|
-
this.
|
|
26
|
-
clearColor: [0, 0, 0, 0],
|
|
27
|
-
blend: true,
|
|
28
|
-
blendFunc: [1, 1],
|
|
29
|
-
blendEquation: 32776,
|
|
30
|
-
depthTest: false
|
|
31
|
-
}, () => this.render({
|
|
32
|
+
this.render({
|
|
32
33
|
...opts,
|
|
33
34
|
target,
|
|
34
35
|
pass: 'terrain-height-map',
|
|
35
36
|
layers: opts.layers,
|
|
36
37
|
viewports: [viewport],
|
|
37
|
-
effects: []
|
|
38
|
-
|
|
38
|
+
effects: [],
|
|
39
|
+
clearColor: [0, 0, 0, 0]
|
|
40
|
+
});
|
|
39
41
|
}
|
|
40
42
|
renderTerrainCover(terrainCover, opts) {
|
|
41
43
|
// console.log('Updating terrain cover ' + terrainCover.id)
|
|
@@ -46,16 +48,22 @@ export class TerrainPass extends LayersPass {
|
|
|
46
48
|
}
|
|
47
49
|
const layers = terrainCover.filterLayers(opts.layers);
|
|
48
50
|
target.resize(viewport);
|
|
49
|
-
this.
|
|
50
|
-
clearColor: [0, 0, 0, 0],
|
|
51
|
-
depthTest: false
|
|
52
|
-
}, () => this.render({
|
|
51
|
+
this.render({
|
|
53
52
|
...opts,
|
|
54
53
|
target,
|
|
55
54
|
pass: `terrain-cover-${terrainCover.id}`,
|
|
56
55
|
layers,
|
|
57
56
|
effects: [],
|
|
58
|
-
viewports: [viewport]
|
|
59
|
-
|
|
57
|
+
viewports: [viewport],
|
|
58
|
+
clearColor: [0, 0, 0, 0]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getLayerParameters(layer, layerIndex, viewport) {
|
|
62
|
+
return {
|
|
63
|
+
...layer.props.parameters,
|
|
64
|
+
blend: true,
|
|
65
|
+
depthTest: false,
|
|
66
|
+
...(layer.props.operation.includes('terrain') && TERRAIN_BLENDING)
|
|
67
|
+
};
|
|
60
68
|
}
|
|
61
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrain-picking-pass.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-picking-pass.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,uBAAuB,EACvB,eAAe,IAAI,cAAc,EAClC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAElD,MAAM,MAAM,+BAA+B,GAAG,uBAAuB,GAAG;IACtE,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,8DAA8D;AAC9D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAEzC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,+BAA+B,GAAG,KAAK,EAAE;IAiBvF,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"terrain-picking-pass.d.ts","sourceRoot":"","sources":["../../src/terrain/terrain-picking-pass.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,uBAAuB,EACvB,eAAe,IAAI,cAAc,EAClC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAC,YAAY,EAAC,2BAAwB;AAElD,MAAM,MAAM,+BAA+B,GAAG,uBAAuB,GAAG;IACtE,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,8DAA8D;AAC9D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD;;;;;OAKG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAEzC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,+BAA+B,GAAG,KAAK,EAAE;IAiBvF,kBAAkB,CAAC,YAAY,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;CAUxF"}
|
|
@@ -39,9 +39,7 @@ export class TerrainPickingPass extends PickLayersPass {
|
|
|
39
39
|
layers.unshift(terrainLayer);
|
|
40
40
|
}
|
|
41
41
|
target.resize(viewport);
|
|
42
|
-
this.
|
|
43
|
-
depthTest: false
|
|
44
|
-
}, () => this.render({
|
|
42
|
+
this.render({
|
|
45
43
|
...opts,
|
|
46
44
|
pickingFBO: target,
|
|
47
45
|
pass: `terrain-cover-picking-${terrainCover.id}`,
|
|
@@ -53,14 +51,17 @@ export class TerrainPickingPass extends PickLayersPass {
|
|
|
53
51
|
cullRect: undefined,
|
|
54
52
|
deviceRect: viewport,
|
|
55
53
|
pickZ: false
|
|
56
|
-
})
|
|
54
|
+
});
|
|
57
55
|
}
|
|
58
56
|
getLayerParameters(layer, layerIndex, viewport) {
|
|
57
|
+
let parameters;
|
|
59
58
|
if (this.drawParameters[layer.id]) {
|
|
60
|
-
|
|
59
|
+
parameters = this.drawParameters[layer.id];
|
|
61
60
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
else {
|
|
62
|
+
parameters = super.getLayerParameters(layer, layerIndex, viewport);
|
|
63
|
+
parameters.blend = true;
|
|
64
|
+
}
|
|
65
|
+
return { ...parameters, depthTest: false };
|
|
65
66
|
}
|
|
66
67
|
}
|
package/dist/terrain/utils.d.ts
CHANGED
|
@@ -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;
|
|
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"}
|
package/dist/terrain/utils.js
CHANGED
|
@@ -4,17 +4,21 @@ export function createRenderTarget(device, opts) {
|
|
|
4
4
|
id: opts.id,
|
|
5
5
|
colorAttachments: [
|
|
6
6
|
device.createTexture({
|
|
7
|
+
id: opts.id,
|
|
7
8
|
...(opts.float && {
|
|
8
9
|
format: 'rgba32float',
|
|
9
10
|
type: 5126
|
|
10
11
|
}),
|
|
11
12
|
mipmaps: false,
|
|
12
|
-
sampler:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
sampler: opts.interpolate === false
|
|
14
|
+
? {
|
|
15
|
+
minFilter: 'nearest',
|
|
16
|
+
magFilter: 'nearest'
|
|
17
|
+
}
|
|
18
|
+
: {
|
|
19
|
+
minFilter: 'linear',
|
|
20
|
+
magFilter: 'linear'
|
|
21
|
+
}
|
|
18
22
|
})
|
|
19
23
|
]
|
|
20
24
|
});
|