@webviz/subsurface-viewer 1.11.9 → 1.11.10
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/components/ColorLegend.d.ts +3 -3
- package/dist/components/ColorLegend.js.map +1 -1
- package/dist/components/ColorLegends.d.ts +2 -2
- package/dist/components/Map.d.ts +1 -7
- package/dist/components/Map.js.map +1 -1
- package/dist/layers/axes/boxLayer.d.ts +1 -2
- package/dist/layers/axes/boxLayer.js.map +1 -1
- package/dist/layers/colormap/colormap.fs.glsl.d.ts +1 -1
- package/dist/layers/colormap/colormap.fs.glsl.js +3 -3
- package/dist/layers/colormap/colormapLayer.d.ts +4 -3
- package/dist/layers/colormap/colormapLayer.js +31 -50
- package/dist/layers/colormap/colormapLayer.js.map +1 -1
- package/dist/layers/drawing/drawingLayer.js.map +1 -1
- package/dist/layers/gpglLayers/typeDefs.d.ts +24 -0
- package/dist/layers/gpglLayers/typeDefs.js +3 -0
- package/dist/layers/gpglLayers/typeDefs.js.map +1 -0
- package/dist/layers/grid3d/cellProperty.fs.glsl.d.ts +1 -1
- package/dist/layers/grid3d/cellProperty.fs.glsl.js +8 -8
- package/dist/layers/grid3d/grid3dLayer.d.ts +5 -4
- package/dist/layers/grid3d/grid3dLayer.js +7 -7
- package/dist/layers/grid3d/nodeProperty.fs.glsl.d.ts +1 -1
- package/dist/layers/grid3d/nodeProperty.fs.glsl.js +2 -2
- package/dist/layers/grid3d/privateGrid3dLayer.d.ts +6 -7
- package/dist/layers/grid3d/privateGrid3dLayer.js +42 -73
- package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
- package/dist/layers/grid3d/typeDefs.d.ts +0 -6
- package/dist/layers/hillshading2d/hillshading2dLayer.js +10 -10
- package/dist/layers/map/map.fs.glsl.d.ts +1 -1
- package/dist/layers/map/map.fs.glsl.js +3 -3
- package/dist/layers/map/mapLayer.d.ts +2 -1
- package/dist/layers/map/mapLayer.js +5 -62
- package/dist/layers/map/mapLayer.js.map +1 -1
- package/dist/layers/map/privateMapLayer.d.ts +7 -7
- package/dist/layers/map/privateMapLayer.js +42 -37
- package/dist/layers/map/privateMapLayer.js.map +1 -1
- package/dist/layers/polylines/polylinesLayer.js +1 -1
- package/dist/layers/polylines/polylinesLayer.js.map +1 -1
- package/dist/layers/selectable_geojson/selectableGeoJsonLayer.js.map +1 -1
- package/dist/layers/shader_modules/decoder.fs.glsl.d.ts +1 -1
- package/dist/layers/shader_modules/decoder.fs.glsl.js +4 -4
- package/dist/layers/triangle/privateTriangleLayer.d.ts +2 -3
- package/dist/layers/triangle/privateTriangleLayer.js.map +1 -1
- package/dist/layers/triangle/triangleLayer.d.ts +2 -1
- package/dist/layers/triangle/triangleLayer.js.map +1 -1
- package/dist/layers/utils/colormapTools.d.ts +46 -0
- package/dist/layers/utils/colormapTools.js +79 -0
- package/dist/layers/utils/colormapTools.js.map +1 -0
- package/dist/layers/utils/layerTools.d.ts +9 -19
- package/dist/layers/utils/layerTools.js +0 -42
- package/dist/layers/utils/layerTools.js.map +1 -1
- package/dist/layers/wells/wellsLayer.d.ts +2 -1
- package/dist/layers/wells/wellsLayer.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/serialize.d.ts +23 -0
- package/dist/utils/serialize.js +105 -0
- package/dist/utils/serialize.js.map +1 -0
- package/dist/utils/typedArray.d.ts +44 -0
- package/dist/utils/typedArray.js +42 -0
- package/dist/utils/typedArray.js.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { Material as DeckGlMaterial } from "@deck.gl/core";
|
2
|
+
/**
|
3
|
+
* Material properties for a graphical surface, used for lighting and shading.
|
4
|
+
*
|
5
|
+
* This type can either be an object specifying material properties,
|
6
|
+
* or a boolean value.
|
7
|
+
*
|
8
|
+
* - If an object, it contains:
|
9
|
+
* - `ambient`: The ambient reflection coefficient.
|
10
|
+
* - `diffuse`: The diffuse reflection coefficient.
|
11
|
+
* - `shininess`: The shininess exponent for specular highlights.
|
12
|
+
* - `specularColor`: The RGB color of the specular reflection as a tuple of three numbers.
|
13
|
+
*
|
14
|
+
* - If a boolean, it may be used as a flag to enable default material or disable the lighting.
|
15
|
+
*/
|
16
|
+
export type Material = {
|
17
|
+
ambient?: number | undefined;
|
18
|
+
diffuse?: number | undefined;
|
19
|
+
shininess?: number | undefined;
|
20
|
+
specularColor?: [number, number, number] | undefined;
|
21
|
+
} | boolean;
|
22
|
+
type Equals<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
|
23
|
+
export declare const _test: Equals<Material, DeckGlMaterial>;
|
24
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"typeDefs.js","sourceRoot":"","sources":["../../../src/layers/gpglLayers/typeDefs.ts"],"names":[],"mappings":"AAgCA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,KAAK,GAAqC,IAAI,CAAC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME grid3d-cell-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nflat in vec3 normal;\nflat in int vertexIndex;\nflat in float property;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\n// Calculate color from propertyValue using discrete colormap.\nvec4 getDiscretePropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n // On some machines (like in docker container), float comparison and texture lookup may fail due to precision.\n // Use this tolerance for comparison and to shift the lookup position.\n float tolerance = (1.0 / grid.
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME grid3d-cell-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nflat in vec3 normal;\nflat in int vertexIndex;\nflat in float property;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\n// Calculate color from propertyValue using discrete colormap.\nvec4 getDiscretePropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n // On some machines (like in docker container), float comparison and texture lookup may fail due to precision.\n // Use this tolerance for comparison and to shift the lookup position.\n float tolerance = (1.0 / grid.colormapSize) * 0.5;\n\n if (propertyValue < grid.colormapRangeMin - tolerance || propertyValue > grid.colormapRangeMax + tolerance) {\n // Out of range. Use clampcolor.\n if (grid.isClampColor) {\n color = grid.colormapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n float p = clamp (propertyValue, grid.colormapRangeMin, grid.colormapRangeMax);\n float x = p / grid.colormapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n }\n else {\n float x = propertyValue / grid.colormapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n \n return color;\n}\n\nvec4 getContinuousPropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float normalizedValue = (propertyValue - grid.colormapRangeMin) / (grid.colormapRangeMax - grid.colormapRangeMin);\n if (normalizedValue < 0.0 || normalizedValue > 1.0) {\n // Out of range. Use clampcolor.\n if (grid.isClampColor) {\n color = grid.colormapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n normalizedValue = clamp (normalizedValue, 0.0, 1.0); \n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n }\n else {\n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n return color;\n}\n\nvoid main(void) {\n\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex); \n return;\n }\n\n if (isnan(property)) {\n vec3 lightColor = lighting_getLightColor(grid.undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, vColor.a);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n return;\n }\n\n // This may happen due to GPU interpolation precision causing color artifacts.\n float propertyValue = clamp(property, grid.valueRangeMin, grid.valueRangeMax);\n \n vec4 color = grid.isColoringDiscrete ? getDiscretePropertyColor(round(propertyValue)) : getContinuousPropertyColor(propertyValue);\n\n // Use two sided phong lighting. This has no effect if \"material\" property is not set.\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, vColor.a);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
|
2
2
|
export default _default;
|
@@ -19,25 +19,25 @@ vec4 getDiscretePropertyColor (float propertyValue) {
|
|
19
19
|
vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
|
20
20
|
// On some machines (like in docker container), float comparison and texture lookup may fail due to precision.
|
21
21
|
// Use this tolerance for comparison and to shift the lookup position.
|
22
|
-
float tolerance = (1.0 / grid.
|
22
|
+
float tolerance = (1.0 / grid.colormapSize) * 0.5;
|
23
23
|
|
24
|
-
if (propertyValue < grid.
|
24
|
+
if (propertyValue < grid.colormapRangeMin - tolerance || propertyValue > grid.colormapRangeMax + tolerance) {
|
25
25
|
// Out of range. Use clampcolor.
|
26
26
|
if (grid.isClampColor) {
|
27
|
-
color = grid.
|
27
|
+
color = grid.colormapClampColor;
|
28
28
|
if( color[3] == 0.0 ) {
|
29
29
|
discard;
|
30
30
|
}
|
31
31
|
}
|
32
32
|
else {
|
33
33
|
// Use min/max color to clamp.
|
34
|
-
float p = clamp (propertyValue, grid.
|
35
|
-
float x = p / grid.
|
34
|
+
float p = clamp (propertyValue, grid.colormapRangeMin, grid.colormapRangeMax);
|
35
|
+
float x = p / grid.colormapSize;
|
36
36
|
color = texture(colormap, vec2(x + tolerance, 0.5));
|
37
37
|
}
|
38
38
|
}
|
39
39
|
else {
|
40
|
-
float x = propertyValue / grid.
|
40
|
+
float x = propertyValue / grid.colormapSize;
|
41
41
|
color = texture(colormap, vec2(x + tolerance, 0.5));
|
42
42
|
}
|
43
43
|
|
@@ -46,11 +46,11 @@ vec4 getDiscretePropertyColor (float propertyValue) {
|
|
46
46
|
|
47
47
|
vec4 getContinuousPropertyColor (float propertyValue) {
|
48
48
|
vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
|
49
|
-
float normalizedValue = (propertyValue - grid.
|
49
|
+
float normalizedValue = (propertyValue - grid.colormapRangeMin) / (grid.colormapRangeMax - grid.colormapRangeMin);
|
50
50
|
if (normalizedValue < 0.0 || normalizedValue > 1.0) {
|
51
51
|
// Out of range. Use clampcolor.
|
52
52
|
if (grid.isClampColor) {
|
53
|
-
color = grid.
|
53
|
+
color = grid.colormapClampColor;
|
54
54
|
if( color[3] == 0.0 ) {
|
55
55
|
discard;
|
56
56
|
}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { Color } from "@deck.gl/core";
|
3
3
|
import { CompositeLayer } from "@deck.gl/core";
|
4
|
-
import type { Material } from "
|
4
|
+
import type { Material } from "../gpglLayers/typeDefs";
|
5
5
|
import PrivateLayer from "./privateGrid3dLayer";
|
6
|
-
import type { ExtendedLayerProps,
|
6
|
+
import type { ExtendedLayerProps, ReportBoundingBoxAction } from "../utils/layerTools";
|
7
|
+
import type { ColorMapFunctionType } from "../utils/colormapTools";
|
7
8
|
export type WebWorkerParams = {
|
8
9
|
points: Float32Array;
|
9
10
|
polys: Uint32Array;
|
@@ -62,7 +63,7 @@ export interface Grid3DLayerProps extends ExtendedLayerProps {
|
|
62
63
|
*/
|
63
64
|
propertiesData: string | number[] | Float32Array | Uint16Array | undefined;
|
64
65
|
/**
|
65
|
-
* Discrete
|
66
|
+
* Discrete property value-name pairs to be displayed in cursor readouts.
|
66
67
|
* The property values are used as the array indices.
|
67
68
|
*/
|
68
69
|
discretePropertyValueNames?: IDiscretePropertyValueName[];
|
@@ -143,5 +144,5 @@ export default class Grid3DLayer extends CompositeLayer<Grid3DLayerProps> {
|
|
143
144
|
private getPropertyValueRange;
|
144
145
|
private getUndefinedPropertyValue;
|
145
146
|
private getUndefinedPropertyColor;
|
146
|
-
private
|
147
|
+
private isColormapFunctionConstantColor;
|
147
148
|
}
|
@@ -169,7 +169,7 @@ export default class Grid3DLayer extends CompositeLayer {
|
|
169
169
|
valueRange: (_a = this.props.colorMapRange) !== null && _a !== void 0 ? _a : propertyValueRange,
|
170
170
|
colorName: this.props.colorMapName,
|
171
171
|
title: "MapLayer",
|
172
|
-
|
172
|
+
colormapFunction: this.props.colorMapFunction,
|
173
173
|
};
|
174
174
|
this.setState({
|
175
175
|
mesh,
|
@@ -216,12 +216,12 @@ export default class Grid3DLayer extends CompositeLayer {
|
|
216
216
|
mesh: this.state["mesh"],
|
217
217
|
meshLines: this.state["mesh_lines"],
|
218
218
|
pickable: this.props.pickable,
|
219
|
-
|
220
|
-
|
221
|
-
|
219
|
+
colormapName: this.props.colorMapName,
|
220
|
+
colormapRange: this.props.colorMapRange,
|
221
|
+
colormapClampColor: this.props.colorMapClampColor,
|
222
222
|
undefinedPropertyValue: undefinedValue,
|
223
223
|
undefinedPropertyColor: undefinedColor,
|
224
|
-
|
224
|
+
colormapFunction: this.props.colorMapFunction,
|
225
225
|
coloringMode: this.props.coloringMode,
|
226
226
|
gridLines: this.props.gridLines,
|
227
227
|
propertyValueRange: this.getPropertyValueRange(),
|
@@ -263,12 +263,12 @@ export default class Grid3DLayer extends CompositeLayer {
|
|
263
263
|
var _a, _b;
|
264
264
|
const colorFunc = this.props.colorMapFunction;
|
265
265
|
if (((_a = this.props.propertiesData) === null || _a === void 0 ? void 0 : _a.length) === 0 &&
|
266
|
-
this.
|
266
|
+
this.isColormapFunctionConstantColor(colorFunc)) {
|
267
267
|
return [colorFunc[0], colorFunc[1], colorFunc[2]];
|
268
268
|
}
|
269
269
|
return (_b = this.props.undefinedPropertyColor) !== null && _b !== void 0 ? _b : [204, 204, 204];
|
270
270
|
}
|
271
|
-
|
271
|
+
isColormapFunctionConstantColor(colorFunc) {
|
272
272
|
return ((Array.isArray(colorFunc) || colorFunc instanceof Uint8Array) &&
|
273
273
|
colorFunc.length >= 3);
|
274
274
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME grid3d-node-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nin float property;\nin vec4 vColor;\n\nflat in vec3 normal;\nflat in int vertexIndex;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nvec4 getPropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float normalizedValue = (propertyValue - grid.
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME grid3d-node-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nin float property;\nin vec4 vColor;\n\nflat in vec3 normal;\nflat in int vertexIndex;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nvec4 getPropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float normalizedValue = (propertyValue - grid.colormapRangeMin) / (grid.colormapRangeMax - grid.colormapRangeMin);\n if (normalizedValue < 0.0 || normalizedValue > 1.0) {\n // Out of range. Use clampcolor.\n if (grid.isClampColor) {\n color = grid.colormapClampColor;\n if( color[3] == 0.0 ) {\n discard;\n }\n }\n else {\n // Use min/max color to clamp.\n normalizedValue = clamp (normalizedValue, 0.0, 1.0); \n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n }\n else {\n color = texture(colormap, vec2(normalizedValue, 0.5));\n }\n return color;\n}\n\n\nvoid main(void) {\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex); \n return;\n }\n\n // This may happen due to GPU interpolation precision causing color artifacts.\n float propertyValue = clamp(property, grid.valueRangeMin, grid.valueRangeMax);\n\n vec4 color = getPropertyColor(propertyValue);\n\n // Use two sided phong lighting. This has no effect if \"material\" property is not set.\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, vColor.a);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
|
2
2
|
export default _default;
|
@@ -16,11 +16,11 @@ uniform sampler2D colormap;
|
|
16
16
|
|
17
17
|
vec4 getPropertyColor (float propertyValue) {
|
18
18
|
vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
|
19
|
-
float normalizedValue = (propertyValue - grid.
|
19
|
+
float normalizedValue = (propertyValue - grid.colormapRangeMin) / (grid.colormapRangeMax - grid.colormapRangeMin);
|
20
20
|
if (normalizedValue < 0.0 || normalizedValue > 1.0) {
|
21
21
|
// Out of range. Use clampcolor.
|
22
22
|
if (grid.isClampColor) {
|
23
|
-
color = grid.
|
23
|
+
color = grid.colormapClampColor;
|
24
24
|
if( color[3] == 0.0 ) {
|
25
25
|
discard;
|
26
26
|
}
|
@@ -2,19 +2,19 @@ import type { Color, PickingInfo, UpdateParameters, LayerContext } from "@deck.g
|
|
2
2
|
import { Layer } from "@deck.gl/core";
|
3
3
|
import type { UniformValue } from "@luma.gl/core";
|
4
4
|
import { Model } from "@luma.gl/engine";
|
5
|
-
import type { DeckGLLayerContext } from "
|
6
|
-
import
|
5
|
+
import type { DeckGLLayerContext, ExtendedLayerProps, LayerPickInfo } from "../utils/layerTools";
|
6
|
+
import { type ColorMapFunctionType } from "../utils/colormapTools";
|
7
7
|
import { TGrid3DColoringMode, type IDiscretePropertyValueName } from "./grid3dLayer";
|
8
8
|
import type { MeshType, MeshTypeLines } from "./typeDefs";
|
9
9
|
export interface PrivateLayerProps extends ExtendedLayerProps {
|
10
10
|
mesh: MeshType;
|
11
11
|
meshLines: MeshTypeLines;
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
colormapName: string;
|
13
|
+
colormapRange: [number, number];
|
14
|
+
colormapClampColor: Color | undefined | boolean;
|
15
15
|
undefinedPropertyValue: number;
|
16
16
|
undefinedPropertyColor: [number, number, number];
|
17
|
-
|
17
|
+
colormapFunction?: ColorMapFunctionType;
|
18
18
|
coloringMode: TGrid3DColoringMode.Property;
|
19
19
|
gridLines: boolean;
|
20
20
|
propertyValueRange: [number, number];
|
@@ -45,5 +45,4 @@ export default class PrivateLayer extends Layer<PrivateLayerProps> {
|
|
45
45
|
private getPropertyText;
|
46
46
|
private getColoringHints;
|
47
47
|
private getUniforms;
|
48
|
-
private getColormapTexture;
|
49
48
|
}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { COORDINATE_SYSTEM, Layer, picking, project32 } from "@deck.gl/core";
|
2
2
|
import { Geometry, Model } from "@luma.gl/engine";
|
3
|
-
import { utilities } from "../shader_modules";
|
4
3
|
import { lighting } from "@luma.gl/shadertools";
|
4
|
+
import { utilities } from "../shader_modules";
|
5
5
|
import { phongMaterial } from "../shader_modules/phong-lighting/phong-material";
|
6
|
-
import { createPropertyData
|
6
|
+
import { createPropertyData } from "../utils/layerTools";
|
7
|
+
import { createColormapTexture, } from "../utils/colormapTools";
|
7
8
|
import linearFragmentShader from "./nodeProperty.fs.glsl";
|
8
9
|
import linearVertexShader from "./nodeProperty.vs.glsl";
|
9
10
|
import flatFragmentShader from "./cellProperty.fs.glsl";
|
@@ -12,21 +13,9 @@ import fsLineShader from "./line.fs.glsl";
|
|
12
13
|
import vsLineShader from "./line.vs.glsl";
|
13
14
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
14
15
|
import { isDiscreteProperty, isGeometricProperty, } from "./grid3dLayer";
|
15
|
-
const DEFAULT_TEXTURE_PARAMETERS = {
|
16
|
-
addressModeU: "clamp-to-edge",
|
17
|
-
addressModeV: "clamp-to-edge",
|
18
|
-
minFilter: "linear",
|
19
|
-
magFilter: "linear",
|
20
|
-
};
|
21
|
-
const DISCRETE_TEXTURE_PARAMETERS = {
|
22
|
-
minFilter: "nearest",
|
23
|
-
magFilter: "nearest",
|
24
|
-
addressModeU: "clamp-to-edge",
|
25
|
-
addressModeV: "clamp-to-edge",
|
26
|
-
};
|
27
16
|
const defaultProps = {
|
28
|
-
|
29
|
-
|
17
|
+
colormapName: "",
|
18
|
+
colormapClampColor: [200, 200, 200],
|
30
19
|
coloringMode: 0,
|
31
20
|
coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,
|
32
21
|
propertyValueRange: [0.0, 1.0],
|
@@ -63,10 +52,14 @@ export default class PrivateLayer extends Layer {
|
|
63
52
|
}
|
64
53
|
//eslint-disable-next-line
|
65
54
|
_getModels(context) {
|
66
|
-
var _a;
|
55
|
+
var _a, _b;
|
67
56
|
const geometricShading = isGeometricProperty(this.props.coloringMode);
|
68
57
|
const uniforms = this.getUniforms();
|
69
|
-
const colormap = this.
|
58
|
+
const colormap = createColormapTexture((_a = this.props.colormapFunction) !== null && _a !== void 0 ? _a : {
|
59
|
+
colormapName: this.props.colormapName,
|
60
|
+
colorTables: this.context.userData
|
61
|
+
.colorTables,
|
62
|
+
}, context, this.getColoringHints());
|
70
63
|
const mesh_model = new Model(context.device, Object.assign(Object.assign({ id: `${this.props.id}-mesh` }, super.getShaders({
|
71
64
|
vs: geometricShading ? linearVertexShader : flatVertexShader,
|
72
65
|
fs: geometricShading
|
@@ -81,7 +74,7 @@ export default class PrivateLayer extends Layer {
|
|
81
74
|
gridUniforms,
|
82
75
|
],
|
83
76
|
})), { geometry: new Geometry({
|
84
|
-
topology: (
|
77
|
+
topology: (_b = this.props.mesh.drawMode) !== null && _b !== void 0 ? _b : "triangle-list",
|
85
78
|
attributes: Object.assign({ positions: this.props.mesh.attributes.positions, normals: this.props.mesh.attributes.normals }, (geometricShading
|
86
79
|
? {}
|
87
80
|
: {
|
@@ -182,10 +175,10 @@ export default class PrivateLayer extends Layer {
|
|
182
175
|
}
|
183
176
|
getColoringHints() {
|
184
177
|
var _a, _b;
|
185
|
-
if (this.props.
|
178
|
+
if (this.props.colormapFunction instanceof Uint8Array) {
|
186
179
|
return {
|
187
180
|
discreteData: true,
|
188
|
-
colormapSize: this.props.
|
181
|
+
colormapSize: this.props.colormapFunction.length / 3,
|
189
182
|
};
|
190
183
|
}
|
191
184
|
if (isDiscreteProperty(this.props.coloringMode)) {
|
@@ -206,26 +199,26 @@ export default class PrivateLayer extends Layer {
|
|
206
199
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
207
200
|
const valueRangeMin = (_b = (_a = this.props.propertyValueRange) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 0.0;
|
208
201
|
const valueRangeMax = (_d = (_c = this.props.propertyValueRange) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : 1.0;
|
209
|
-
// If specified color map will extend from
|
202
|
+
// If specified color map will extend from colormapRangeMin to colormapRangeMax.
|
210
203
|
// Otherwise it will extend from valueRangeMin to valueRangeMax.
|
211
|
-
const
|
212
|
-
const
|
213
|
-
const
|
214
|
-
const hasClampColor = this.props.
|
215
|
-
this.props.
|
216
|
-
this.props.
|
217
|
-
let
|
218
|
-
if (
|
219
|
-
|
204
|
+
const colormapRangeMin = (_f = (_e = this.props.colormapRange) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : valueRangeMin;
|
205
|
+
const colormapRangeMax = (_h = (_g = this.props.colormapRange) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : valueRangeMax;
|
206
|
+
const isColormapClampColorTransparent = this.props.colormapClampColor === false;
|
207
|
+
const hasClampColor = this.props.colormapClampColor !== undefined &&
|
208
|
+
this.props.colormapClampColor !== true &&
|
209
|
+
this.props.colormapClampColor !== false;
|
210
|
+
let colormapClampColor = (hasClampColor ? this.props.colormapClampColor : [0, 0, 0, 255]);
|
211
|
+
if (isColormapClampColorTransparent) {
|
212
|
+
colormapClampColor = [0, 0, 0, 0];
|
220
213
|
}
|
221
|
-
if (
|
222
|
-
|
214
|
+
if (colormapClampColor.length === 3) {
|
215
|
+
colormapClampColor = [...colormapClampColor, 255];
|
223
216
|
}
|
224
|
-
const isClampColor = hasClampColor ||
|
217
|
+
const isClampColor = hasClampColor || isColormapClampColorTransparent;
|
225
218
|
// Normalize to [0,1] range.
|
226
|
-
const
|
227
|
-
if (
|
228
|
-
|
219
|
+
const colormapClampColorUniform = colormapClampColor.map((x) => (x !== null && x !== void 0 ? x : 0) / 255);
|
220
|
+
if (isColormapClampColorTransparent) {
|
221
|
+
colormapClampColor[3] = 0;
|
229
222
|
}
|
230
223
|
const undefinedPropertyColorUniform = this.props.undefinedPropertyColor.map((x) => (x !== null && x !== void 0 ? x : 0) / 255);
|
231
224
|
const coloringHints = this.getColoringHints();
|
@@ -233,39 +226,15 @@ export default class PrivateLayer extends Layer {
|
|
233
226
|
ZIncreasingDownwards: this.props.ZIncreasingDownwards,
|
234
227
|
valueRangeMin,
|
235
228
|
valueRangeMax,
|
236
|
-
|
237
|
-
|
238
|
-
|
229
|
+
colormapRangeMin: colormapRangeMin,
|
230
|
+
colormapRangeMax: colormapRangeMax,
|
231
|
+
colormapClampColor: Array.from(colormapClampColorUniform),
|
239
232
|
isClampColor,
|
240
233
|
coloringMode: this.props.coloringMode,
|
241
234
|
undefinedPropertyColor: undefinedPropertyColorUniform,
|
242
235
|
isColoringDiscrete: coloringHints.discreteData,
|
243
|
-
|
244
|
-
};
|
245
|
-
}
|
246
|
-
getColormapTexture(context) {
|
247
|
-
const textureProps = {
|
248
|
-
sampler: DEFAULT_TEXTURE_PARAMETERS,
|
249
|
-
width: 256,
|
250
|
-
height: 1,
|
251
|
-
format: "rgb8unorm-webgl",
|
236
|
+
colormapSize: coloringHints.colormapSize,
|
252
237
|
};
|
253
|
-
const colormapHints = this.getColoringHints();
|
254
|
-
if (colormapHints.discreteData) {
|
255
|
-
if (colormapHints.colormapSize === 0) {
|
256
|
-
const colormap = context.device.createTexture(Object.assign(Object.assign({}, textureProps), { sampler: DISCRETE_TEXTURE_PARAMETERS, width: colormapHints.colormapSize, data: new Uint8Array([0, 0, 0, 0, 0, 0]) }));
|
257
|
-
return colormap;
|
258
|
-
}
|
259
|
-
const colormapData = this.props.colorMapFunction instanceof Uint8Array
|
260
|
-
? this.props.colorMapFunction
|
261
|
-
: getImageData(this.props.colorMapName, this.context.userData
|
262
|
-
.colorTables, this.props.colorMapFunction, colormapHints.colormapSize, colormapHints.discreteData);
|
263
|
-
const colormap = context.device.createTexture(Object.assign(Object.assign({}, textureProps), { sampler: DISCRETE_TEXTURE_PARAMETERS, width: colormapHints.colormapSize, data: colormapData }));
|
264
|
-
return colormap;
|
265
|
-
}
|
266
|
-
const data = getImageData(this.props.colorMapName, this.context.userData.colorTables, this.props.colorMapFunction);
|
267
|
-
const colormap = context.device.createTexture(Object.assign(Object.assign({}, textureProps), { data: data }));
|
268
|
-
return colormap;
|
269
238
|
}
|
270
239
|
}
|
271
240
|
PrivateLayer.layerName = "PrivateLayer";
|
@@ -276,14 +245,14 @@ uniform gridUniforms {
|
|
276
245
|
bool ZIncreasingDownwards;
|
277
246
|
float valueRangeMin;
|
278
247
|
float valueRangeMax;
|
279
|
-
float
|
280
|
-
float
|
281
|
-
vec4
|
248
|
+
float colormapRangeMin;
|
249
|
+
float colormapRangeMax;
|
250
|
+
vec4 colormapClampColor;
|
282
251
|
bool isClampColor;
|
283
252
|
float coloringMode;
|
284
253
|
vec3 undefinedPropertyColor;
|
285
254
|
bool isColoringDiscrete;
|
286
|
-
float
|
255
|
+
float colormapSize;
|
287
256
|
} grid;
|
288
257
|
`;
|
289
258
|
const gridUniforms = {
|
@@ -294,14 +263,14 @@ const gridUniforms = {
|
|
294
263
|
ZIncreasingDownwards: "u32",
|
295
264
|
valueRangeMin: "f32",
|
296
265
|
valueRangeMax: "f32",
|
297
|
-
|
298
|
-
|
299
|
-
|
266
|
+
colormapRangeMin: "f32",
|
267
|
+
colormapRangeMax: "f32",
|
268
|
+
colormapClampColor: "vec4<f32>",
|
300
269
|
isClampColor: "u32",
|
301
270
|
coloringMode: "f32",
|
302
271
|
undefinedPropertyColor: "vec3<f32>",
|
303
272
|
isColoringDiscrete: "u32",
|
304
|
-
|
273
|
+
colormapSize: "f32",
|
305
274
|
},
|
306
275
|
};
|
307
276
|
//#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AAE,EAAE,iBAAiB;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,WAAW;QAC/B,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,KAAK;QACnB,sBAAsB,EAAE,WAAW;QACnC,kBAAkB,EAAE,KAAK;QACzB,YAAY,EAAE,KAAK;KACtB;CAC0D,CAAC"}
|
@@ -36,12 +36,6 @@ export type MeshTypeLines = {
|
|
36
36
|
};
|
37
37
|
vertexCount: number;
|
38
38
|
};
|
39
|
-
export type Material = {
|
40
|
-
ambient: number;
|
41
|
-
diffuse: number;
|
42
|
-
shininess: number;
|
43
|
-
specularColor: [number, number, number];
|
44
|
-
} | boolean;
|
45
39
|
export type WebWorkerParams = {
|
46
40
|
points: Float32Array;
|
47
41
|
polys: Uint32Array;
|
@@ -55,8 +55,8 @@ export default class Hillshading2DLayer extends BitmapLayer {
|
|
55
55
|
}
|
56
56
|
const valueRangeMin = (_c = this.props.valueRange[0]) !== null && _c !== void 0 ? _c : 0.0;
|
57
57
|
const valueRangeMax = (_d = this.props.valueRange[1]) !== null && _d !== void 0 ? _d : 1.0;
|
58
|
-
const
|
59
|
-
const
|
58
|
+
const colormapRangeMin = (_f = (_e = this.props.colorMapRange) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : valueRangeMin;
|
59
|
+
const colormapRangeMax = (_h = (_g = this.props.colorMapRange) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : valueRangeMax;
|
60
60
|
const [minVal, maxVal] = this.props.valueRange;
|
61
61
|
const bitmapResolution = this.props.image
|
62
62
|
? [
|
@@ -72,8 +72,8 @@ export default class Hillshading2DLayer extends BitmapLayer {
|
|
72
72
|
map: {
|
73
73
|
valueRangeMin,
|
74
74
|
valueRangeMax,
|
75
|
-
|
76
|
-
|
75
|
+
colormapRangeMin,
|
76
|
+
colormapRangeMax,
|
77
77
|
bitmapResolution,
|
78
78
|
valueRangeSize,
|
79
79
|
lightDirection,
|
@@ -115,8 +115,8 @@ const map2DUniformsBlock = /*glsl*/ `\
|
|
115
115
|
uniform mapUniforms {
|
116
116
|
float valueRangeMin;
|
117
117
|
float valueRangeMax;
|
118
|
-
float
|
119
|
-
float
|
118
|
+
float colormapRangeMin;
|
119
|
+
float colormapRangeMax;
|
120
120
|
|
121
121
|
vec2 bitmapResolution;
|
122
122
|
float valueRangeSize;
|
@@ -139,9 +139,9 @@ float decode_rgb2float(vec3 rgb) {
|
|
139
139
|
value = floor(value / map.step + 0.5) * map.step;
|
140
140
|
}
|
141
141
|
|
142
|
-
// If
|
142
|
+
// If colormapRangeMin/Max specified, color map will span this interval.
|
143
143
|
float x = value * (map.valueRangeMax - map.valueRangeMin) + map.valueRangeMin;
|
144
|
-
x = (x - map.
|
144
|
+
x = (x - map.colormapRangeMin) / (map.colormapRangeMax - map.colormapRangeMin);
|
145
145
|
x = max(0.0, x);
|
146
146
|
x = min(1.0, x);
|
147
147
|
|
@@ -156,8 +156,8 @@ const map2DUniforms = {
|
|
156
156
|
uniformTypes: {
|
157
157
|
valueRangeMin: "f32",
|
158
158
|
valueRangeMax: "f32",
|
159
|
-
|
160
|
-
|
159
|
+
colormapRangeMin: "f32",
|
160
|
+
colormapRangeMax: "f32",
|
161
161
|
bitmapResolution: "vec2<f32>",
|
162
162
|
valueRangeSize: "f32",
|
163
163
|
lightDirection: "vec3<f32>",
|
@@ -1,2 +1,2 @@
|
|
1
|
-
declare const _default: "#version 300 es\n#define SHADER_NAME map-fragment-shader\n\nprecision highp float;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nin vec3 worldPos;\nin float property;\nflat in int vertexIndex;\n\n// Uniforms\nuniform sampler2D colormap;\n\nout vec4 fragColor;\n\n\nvoid main(void) { \n geometry.uv = vTexCoord;\n\n vec3 normal = normals_commonspace;\n\n if(!map.smoothShading || (normal[0] == 0.0 && normal[1] == 0.0 && normal[2] == 0.0)) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n }\n\n //Picking pass.\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex);\n return;\n }\n\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float propertyValue = property;\n\n // This may happen due to GPU interpolation precision causing color artifacts.\n propertyValue = clamp(propertyValue, map.valueRangeMin, map.valueRangeMax);\n\n float x = (propertyValue - map.
|
1
|
+
declare const _default: "#version 300 es\n#define SHADER_NAME map-fragment-shader\n\nprecision highp float;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nin vec3 worldPos;\nin float property;\nflat in int vertexIndex;\n\n// Uniforms\nuniform sampler2D colormap;\n\nout vec4 fragColor;\n\n\nvoid main(void) { \n geometry.uv = vTexCoord;\n\n vec3 normal = normals_commonspace;\n\n if(!map.smoothShading || (normal[0] == 0.0 && normal[1] == 0.0 && normal[2] == 0.0)) {\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n }\n\n //Picking pass.\n if (picking.isActive > 0.5 && !(picking.isAttribute > 0.5)) {\n fragColor = encodeVertexIndexToRGB(vertexIndex);\n return;\n }\n\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float propertyValue = property;\n\n // This may happen due to GPU interpolation precision causing color artifacts.\n propertyValue = clamp(propertyValue, map.valueRangeMin, map.valueRangeMax);\n\n float x = (propertyValue - map.colormapRangeMin) / (map.colormapRangeMax - map.colormapRangeMin);\n if (x < 0.0 || x > 1.0) {\n // Out of range. Use clampcolor.\n if (map.isClampColor) {\n color = vec4(map.colormapClampColor.rgb, 1.0);\n }\n else if (map.isColormapClampColorTransparent) {\n discard;\n return;\n }\n else {\n // Use min/max color to clamp.\n x = max(0.0, x);\n x = min(1.0, x);\n\n color = texture(colormap, vec2(x, 0.5));\n }\n }\n else {\n color = texture(colormap, vec2(x, 0.5));\n }\n\n bool is_contours = map.contourReferencePoint != -1.0 && map.contourInterval != -1.0;\n if (is_contours) {\n float val = map.isContoursDepth ? (abs(worldPos.z) - map.contourReferencePoint) / map.contourInterval\n : (propertyValue - map.contourReferencePoint) / map.contourInterval;\n\n float f = fract(val);\n float df = fwidth(val);\n\n // keep: float c = smoothstep(df * 1.0, df * 2.0, f); // smootstep from/to no of pixels distance from contour line.\n float c = smoothstep(0.0, df * 2.0, f);\n\n color = color * vec4(c, c, c, 1.0);\n }\n\n // Use two sided phong lighting. This has no effect if \"material\" property is not set.\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n\n fragColor = vec4(lightColor, vColor.a);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
|
2
2
|
export default _default;
|
@@ -39,13 +39,13 @@ void main(void) {
|
|
39
39
|
// This may happen due to GPU interpolation precision causing color artifacts.
|
40
40
|
propertyValue = clamp(propertyValue, map.valueRangeMin, map.valueRangeMax);
|
41
41
|
|
42
|
-
float x = (propertyValue - map.
|
42
|
+
float x = (propertyValue - map.colormapRangeMin) / (map.colormapRangeMax - map.colormapRangeMin);
|
43
43
|
if (x < 0.0 || x > 1.0) {
|
44
44
|
// Out of range. Use clampcolor.
|
45
45
|
if (map.isClampColor) {
|
46
|
-
color = vec4(map.
|
46
|
+
color = vec4(map.colormapClampColor.rgb, 1.0);
|
47
47
|
}
|
48
|
-
else if (map.
|
48
|
+
else if (map.isColormapClampColorTransparent) {
|
49
49
|
discard;
|
50
50
|
return;
|
51
51
|
}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type { Color, CompositeLayerProps, Layer, Material, UpdateParameters } from "@deck.gl/core";
|
3
3
|
import { CompositeLayer } from "@deck.gl/core";
|
4
|
-
import type { ReportBoundingBoxAction, ExtendedLayerProps
|
4
|
+
import type { ReportBoundingBoxAction, ExtendedLayerProps } from "../utils/layerTools";
|
5
|
+
import type { ColorMapFunctionType } from "../utils/colormapTools";
|
5
6
|
import PrivateMapLayer from "./privateMapLayer";
|
6
7
|
type Frame = {
|
7
8
|
/** mesh origin
|