@webviz/subsurface-viewer 1.11.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/extensions/side-projection-extension.d.ts +41 -6
  2. package/dist/extensions/side-projection-extension.js +33 -27
  3. package/dist/extensions/side-projection-extension.js.map +1 -1
  4. package/dist/layers/axes/axes-fragment.glsl.d.ts +1 -1
  5. package/dist/layers/axes/axes-fragment.glsl.js +1 -1
  6. package/dist/layers/axes/grid-vertex.glsl.d.ts +1 -1
  7. package/dist/layers/axes/grid-vertex.glsl.js +1 -1
  8. package/dist/layers/axes2d/axes2DLayer.d.ts +7 -7
  9. package/dist/layers/axes2d/axes2DLayer.js +62 -14
  10. package/dist/layers/axes2d/axes2DLayer.js.map +1 -1
  11. package/dist/layers/axes2d/label-fragment.glsl.d.ts +1 -1
  12. package/dist/layers/axes2d/label-fragment.glsl.js +7 -10
  13. package/dist/layers/axes2d/label-fragment.glsl.js.map +1 -1
  14. package/dist/layers/axes2d/label-vertex.glsl.d.ts +1 -1
  15. package/dist/layers/axes2d/label-vertex.glsl.js +1 -1
  16. package/dist/layers/axes2d/line-fragment.glsl.d.ts +1 -1
  17. package/dist/layers/axes2d/line-fragment.glsl.js +2 -4
  18. package/dist/layers/axes2d/line-fragment.glsl.js.map +1 -1
  19. package/dist/layers/axes2d/line-vertex.glsl.d.ts +1 -1
  20. package/dist/layers/axes2d/line-vertex.glsl.js +2 -4
  21. package/dist/layers/axes2d/line-vertex.glsl.js.map +1 -1
  22. package/dist/layers/colormap/colormap.fs.glsl.d.ts +1 -1
  23. package/dist/layers/colormap/colormap.fs.glsl.js +2 -5
  24. package/dist/layers/colormap/colormap.fs.glsl.js.map +1 -1
  25. package/dist/layers/colormap/colormapLayer.d.ts +3 -2
  26. package/dist/layers/colormap/colormapLayer.js +81 -25
  27. package/dist/layers/colormap/colormapLayer.js.map +1 -1
  28. package/dist/layers/grid3d/cellProperty.fs.glsl.d.ts +1 -1
  29. package/dist/layers/grid3d/cellProperty.fs.glsl.js +14 -27
  30. package/dist/layers/grid3d/cellProperty.fs.glsl.js.map +1 -1
  31. package/dist/layers/grid3d/cellProperty.vs.glsl.d.ts +1 -1
  32. package/dist/layers/grid3d/cellProperty.vs.glsl.js +2 -4
  33. package/dist/layers/grid3d/cellProperty.vs.glsl.js.map +1 -1
  34. package/dist/layers/grid3d/fragment_lines.glsl.d.ts +1 -1
  35. package/dist/layers/grid3d/fragment_lines.glsl.js +1 -1
  36. package/dist/layers/grid3d/grid3dLayer.js +2 -0
  37. package/dist/layers/grid3d/grid3dLayer.js.map +1 -1
  38. package/dist/layers/grid3d/nodeProperty.fs.glsl.d.ts +1 -1
  39. package/dist/layers/grid3d/nodeProperty.fs.glsl.js +5 -13
  40. package/dist/layers/grid3d/nodeProperty.fs.glsl.js.map +1 -1
  41. package/dist/layers/grid3d/nodeProperty.vs.glsl.d.ts +1 -1
  42. package/dist/layers/grid3d/nodeProperty.vs.glsl.js +3 -7
  43. package/dist/layers/grid3d/nodeProperty.vs.glsl.js.map +1 -1
  44. package/dist/layers/grid3d/privateGrid3dLayer.d.ts +26 -5
  45. package/dist/layers/grid3d/privateGrid3dLayer.js +60 -22
  46. package/dist/layers/grid3d/privateGrid3dLayer.js.map +1 -1
  47. package/dist/layers/grid3d/vertex_lines.glsl.d.ts +1 -1
  48. package/dist/layers/grid3d/vertex_lines.glsl.js +2 -4
  49. package/dist/layers/grid3d/vertex_lines.glsl.js.map +1 -1
  50. package/dist/layers/hillshading2d/hillshading2d.fs.glsl.d.ts +1 -1
  51. package/dist/layers/hillshading2d/hillshading2d.fs.glsl.js +8 -15
  52. package/dist/layers/hillshading2d/hillshading2d.fs.glsl.js.map +1 -1
  53. package/dist/layers/hillshading2d/hillshading2dLayer.d.ts +4 -3
  54. package/dist/layers/hillshading2d/hillshading2dLayer.js +109 -33
  55. package/dist/layers/hillshading2d/hillshading2dLayer.js.map +1 -1
  56. package/dist/layers/map/fragment.glsl.d.ts +2 -0
  57. package/dist/layers/map/{fragment.fs.glsl.js → fragment.glsl.js} +15 -27
  58. package/dist/layers/map/fragment.glsl.js.map +1 -0
  59. package/dist/layers/map/fragment_lines.glsl.d.ts +1 -1
  60. package/dist/layers/map/fragment_lines.glsl.js +1 -1
  61. package/dist/layers/map/mapLayer.d.ts +1 -1
  62. package/dist/layers/map/mapLayer.js +2 -0
  63. package/dist/layers/map/mapLayer.js.map +1 -1
  64. package/dist/layers/map/privateMapLayer.d.ts +7 -9
  65. package/dist/layers/map/privateMapLayer.js +85 -17
  66. package/dist/layers/map/privateMapLayer.js.map +1 -1
  67. package/dist/layers/map/vertex.glsl.d.ts +1 -1
  68. package/dist/layers/map/vertex.glsl.js +3 -5
  69. package/dist/layers/map/vertex.glsl.js.map +1 -1
  70. package/dist/layers/map/vertex_lines.glsl.d.ts +1 -1
  71. package/dist/layers/map/vertex_lines.glsl.js +3 -2
  72. package/dist/layers/map/vertex_lines.glsl.js.map +1 -1
  73. package/dist/layers/northarrow/northArrow3DLayer.d.ts +1 -1
  74. package/dist/layers/northarrow/northArrow3DLayer.js +3 -3
  75. package/dist/layers/northarrow/northArrow3DLayer.js.map +1 -1
  76. package/dist/layers/northarrow/northarrow-fragment.glsl.d.ts +1 -1
  77. package/dist/layers/northarrow/northarrow-fragment.glsl.js +1 -1
  78. package/dist/layers/northarrow/northarrow-vertex.glsl.d.ts +1 -1
  79. package/dist/layers/northarrow/northarrow-vertex.glsl.js +1 -1
  80. package/dist/layers/piechart/fragment.glsl.d.ts +1 -1
  81. package/dist/layers/piechart/fragment.glsl.js +1 -1
  82. package/dist/layers/piechart/vertex.glsl.d.ts +1 -1
  83. package/dist/layers/piechart/vertex.glsl.js +1 -1
  84. package/dist/layers/points/privatePointsLayer.d.ts +1 -9
  85. package/dist/layers/points/privatePointsLayer.js +32 -5
  86. package/dist/layers/points/privatePointsLayer.js.map +1 -1
  87. package/dist/layers/points/vertex.glsl.d.ts +1 -1
  88. package/dist/layers/points/vertex.glsl.js +13 -28
  89. package/dist/layers/points/vertex.glsl.js.map +1 -1
  90. package/dist/layers/polylines/path-layer-fragment.glsl.d.ts +1 -1
  91. package/dist/layers/polylines/path-layer-fragment.glsl.js +2 -4
  92. package/dist/layers/polylines/path-layer-fragment.glsl.js.map +1 -1
  93. package/dist/layers/polylines/path-layer-vertex.glsl.d.ts +1 -1
  94. package/dist/layers/polylines/path-layer-vertex.glsl.js +10 -22
  95. package/dist/layers/polylines/path-layer-vertex.glsl.js.map +1 -1
  96. package/dist/layers/polylines/privatePolylinesLayer.d.ts +2 -44
  97. package/dist/layers/polylines/privatePolylinesLayer.js +34 -4
  98. package/dist/layers/polylines/privatePolylinesLayer.js.map +1 -1
  99. package/dist/layers/shader_modules/index.d.ts +1 -1
  100. package/dist/layers/shader_modules/index.js +1 -1
  101. package/dist/layers/shader_modules/index.js.map +1 -1
  102. package/dist/layers/shader_modules/phong-lighting/phong-material.d.ts +11 -0
  103. package/dist/layers/shader_modules/phong-lighting/phong-material.js +38 -0
  104. package/dist/layers/shader_modules/phong-lighting/phong-material.js.map +1 -0
  105. package/dist/layers/shader_modules/phong-lighting/phong-shaders-glsl.d.ts +2 -0
  106. package/dist/layers/shader_modules/phong-lighting/phong-shaders-glsl.js +59 -0
  107. package/dist/layers/shader_modules/phong-lighting/phong-shaders-glsl.js.map +1 -0
  108. package/dist/layers/triangle/fragment.fs.glsl.d.ts +1 -1
  109. package/dist/layers/triangle/fragment.fs.glsl.js +7 -14
  110. package/dist/layers/triangle/fragment.fs.glsl.js.map +1 -1
  111. package/dist/layers/triangle/fragment_lines.glsl.d.ts +1 -1
  112. package/dist/layers/triangle/fragment_lines.glsl.js +1 -1
  113. package/dist/layers/triangle/privateTriangleLayer.d.ts +9 -14
  114. package/dist/layers/triangle/privateTriangleLayer.js +75 -26
  115. package/dist/layers/triangle/privateTriangleLayer.js.map +1 -1
  116. package/dist/layers/triangle/triangleLayer.d.ts +1 -1
  117. package/dist/layers/triangle/triangleLayer.js +2 -0
  118. package/dist/layers/triangle/triangleLayer.js.map +1 -1
  119. package/dist/layers/triangle/vertex.glsl.d.ts +1 -1
  120. package/dist/layers/triangle/vertex.glsl.js +3 -5
  121. package/dist/layers/triangle/vertex.glsl.js.map +1 -1
  122. package/dist/layers/triangle/vertex_lines.glsl.d.ts +1 -1
  123. package/dist/layers/triangle/vertex_lines.glsl.js +2 -4
  124. package/dist/layers/triangle/vertex_lines.glsl.js.map +1 -1
  125. package/dist/layers/utils/layerTools.d.ts +1 -1
  126. package/dist/layers/utils/layerTools.js +1 -1
  127. package/dist/layers/utils/layerTools.js.map +1 -1
  128. package/dist/layers/well_markers/vertex.glsl.d.ts +1 -1
  129. package/dist/layers/well_markers/vertex.glsl.js +3 -7
  130. package/dist/layers/well_markers/vertex.glsl.js.map +1 -1
  131. package/dist/layers/well_markers/wellMarkersLayer.d.ts +3 -8
  132. package/dist/layers/well_markers/wellMarkersLayer.js +49 -16
  133. package/dist/layers/well_markers/wellMarkersLayer.js.map +1 -1
  134. package/dist/views/intersectionView.d.ts +3 -3
  135. package/dist/views/intersectionView.js +5 -0
  136. package/dist/views/intersectionView.js.map +1 -1
  137. package/package.json +11 -11
  138. package/dist/layers/map/fragment.fs.glsl.d.ts +0 -2
  139. package/dist/layers/map/fragment.fs.glsl.js.map +0 -1
  140. package/dist/layers/shader_modules/lighting.fs.glsl.d.ts +0 -1
  141. package/dist/layers/shader_modules/lighting.fs.glsl.js +0 -45
  142. package/dist/layers/shader_modules/lighting.fs.glsl.js.map +0 -1
  143. package/dist/layers/shader_modules/localPhongLighting.d.ts +0 -23
  144. package/dist/layers/shader_modules/localPhongLighting.js +0 -8
  145. package/dist/layers/shader_modules/localPhongLighting.js.map +0 -1
@@ -1,2 +1,2 @@
1
- declare const fsColormap = "#version 300 es\n#define SHADER_NAME colormap-shader\n\nprecision highp float;\n\nin vec2 vTexCoord;\n\nout vec4 fragColor;\n\nuniform sampler2D bitmapTexture; // Property map\nuniform sampler2D colormap;\n\nuniform float opacity;\n\nvoid main(void) {\n vec4 bitmapColor = texture(bitmapTexture, vTexCoord);\n\n // If it's a picking pass, we just return the raw property map value.\n if (picking.isActive > 0.5) {\n fragColor = bitmapColor;\n return;\n }\n\n // Decode the RGB value into a float. See decoder.fs.glsl for more details.\n float val = decode_rgb2float(bitmapColor.rgb);\n // The resulting val will be in [0, 1] interval, so we can use it directly as a texture coord\n // to sample from the colormap.\n // 0 => Leftmost color in the colormap, 1 => rightmost color, linearly interpolated in between.\n vec4 color = texture(colormap, vec2(val, 0.5));\n\n // The final pixel opacity is the combination of the user provided image-wide opacity,\n // the colormap opacity at the sampled pixel and the property map opacity of the sampled pixel.\n fragColor = vec4(color.rgb, color.a * bitmapColor.a * opacity);\n\n // Support for existing functionality that comes from the BitmapLayer, such as desaturate, tintColor etc.\n // See https://deck.gl/docs/api-reference/layers/bitmap-layer#render-options for more details.\n geometry.uv = vTexCoord;\n DECKGL_FILTER_COLOR(fragColor, geometry);\n\n}\n";
1
+ declare const fsColormap = "#version 300 es\n#define SHADER_NAME colormap-fragment-shader\n\nprecision highp float;\n\nin vec2 vTexCoord;\n\nout vec4 fragColor;\n\nuniform sampler2D bitmapTexture; // Property map\nuniform sampler2D colormap;\n\nvoid main(void) {\n vec4 bitmapColor = texture(bitmapTexture, vTexCoord);\n\n // If it's a picking pass, we just return the raw property map value.\n if (picking.isActive > 0.5) {\n fragColor = bitmapColor;\n return;\n }\n\n // Decode the RGB value into a float. See decoder.fs.glsl for more details.\n float val = decode_rgb2float(bitmapColor.rgb);\n // The resulting val will be in [0, 1] interval, so we can use it directly as a texture coord\n // to sample from the colormap.\n // 0 => Leftmost color in the colormap, 1 => rightmost color, linearly interpolated in between.\n vec4 color = texture(colormap, vec2(val, 0.5));\n\n // The final pixel opacity is the combination of the user provided image-wide opacity,\n // the colormap opacity at the sampled pixel and the property map opacity of the sampled pixel.\n fragColor = vec4(color.rgb, color.a * bitmapColor.a * layer.opacity);\n\n // Support for existing functionality that comes from the BitmapLayer, such as desaturate, tintColor etc.\n // See https://deck.gl/docs/api-reference/layers/bitmap-layer#render-options for more details.\n geometry.uv = vTexCoord;\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
2
2
  export default fsColormap;
@@ -1,5 +1,5 @@
1
1
  const fsColormap = `#version 300 es
2
- #define SHADER_NAME colormap-shader
2
+ #define SHADER_NAME colormap-fragment-shader
3
3
 
4
4
  precision highp float;
5
5
 
@@ -10,8 +10,6 @@ out vec4 fragColor;
10
10
  uniform sampler2D bitmapTexture; // Property map
11
11
  uniform sampler2D colormap;
12
12
 
13
- uniform float opacity;
14
-
15
13
  void main(void) {
16
14
  vec4 bitmapColor = texture(bitmapTexture, vTexCoord);
17
15
 
@@ -30,13 +28,12 @@ void main(void) {
30
28
 
31
29
  // The final pixel opacity is the combination of the user provided image-wide opacity,
32
30
  // the colormap opacity at the sampled pixel and the property map opacity of the sampled pixel.
33
- fragColor = vec4(color.rgb, color.a * bitmapColor.a * opacity);
31
+ fragColor = vec4(color.rgb, color.a * bitmapColor.a * layer.opacity);
34
32
 
35
33
  // Support for existing functionality that comes from the BitmapLayer, such as desaturate, tintColor etc.
36
34
  // See https://deck.gl/docs/api-reference/layers/bitmap-layer#render-options for more details.
37
35
  geometry.uv = vTexCoord;
38
36
  DECKGL_FILTER_COLOR(fragColor, geometry);
39
-
40
37
  }
41
38
  `;
42
39
  export default fsColormap;
@@ -1 +1 @@
1
- {"version":3,"file":"colormap.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/colormap/colormap.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwClB,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"colormap.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/colormap/colormap.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqClB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -3,10 +3,11 @@ import type { BitmapLayerPickingInfo, BitmapLayerProps } from "@deck.gl/layers";
3
3
  import { BitmapLayer } from "@deck.gl/layers";
4
4
  import type { PickingInfo } from "@deck.gl/core";
5
5
  import type { LayerPickInfo, TypeAndNameLayerProps } from "../../layers/utils/layerTools";
6
- import type { ValueDecoder } from "../utils/propertyMapTools";
6
+ import { type ValueDecoder } from "../utils/propertyMapTools";
7
7
  import type { ColorMapFunctionType } from "../utils/layerTools";
8
8
  import type { ReportBoundingBoxAction } from "../../components/Map";
9
9
  import type { ContinuousLegendDataType } from "../../components/ColorLegend";
10
+ import type { Model } from "@luma.gl/engine";
10
11
  export interface ColormapLayerProps extends BitmapLayerProps, TypeAndNameLayerProps {
11
12
  colorMapName: string;
12
13
  colorMapFunction?: ColorMapFunctionType;
@@ -18,7 +19,7 @@ export interface ColormapLayerProps extends BitmapLayerProps, TypeAndNameLayerPr
18
19
  }
19
20
  export default class ColormapLayer extends BitmapLayer<ColormapLayerProps> {
20
21
  initializeState(): void;
21
- draw({ moduleParameters, uniforms }: any): void;
22
+ setShaderModuleProps(...props: Parameters<Model["shaderInputs"]["setProps"]>): void;
22
23
  getShaders(): any;
23
24
  getPickingInfo({ info, }: {
24
25
  info: PickingInfo;
@@ -1,9 +1,9 @@
1
1
  import { BitmapLayer } from "@deck.gl/layers";
2
- import { decoder } from "../shader_modules";
3
2
  import { decodeRGB } from "../utils/propertyMapTools";
4
3
  import { getModelMatrix } from "../utils/layerTools";
5
4
  import fsColormap from "./colormap.fs.glsl";
6
5
  import { getRgbData } from "@emerson-eps/color-tables";
6
+ import { project32 } from "@deck.gl/core";
7
7
  function getImageData(colorMapName, colorTables, colorMapFunction) {
8
8
  const isColorMapFunctionDefined = typeof colorMapFunction !== "undefined";
9
9
  const data = new Uint8Array(256 * 3);
@@ -49,10 +49,8 @@ export default class ColormapLayer extends BitmapLayer {
49
49
  initializeState() {
50
50
  super.initializeState();
51
51
  }
52
- // Signature from the base class, eslint doesn't like the any type.
53
- // eslint-disable-next-line
54
- draw({ moduleParameters, uniforms }) {
55
- var _a, _b, _c, _d, _e, _f, _g;
52
+ setShaderModuleProps(...props) {
53
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
56
54
  if (!this.isLoaded) {
57
55
  if (typeof this.props.reportBoundingBox !== "undefined") {
58
56
  const xMin = this.props.bounds[0];
@@ -66,41 +64,51 @@ export default class ColormapLayer extends BitmapLayer {
66
64
  });
67
65
  }
68
66
  }
69
- const mergedModuleParams = Object.assign(Object.assign({}, moduleParameters), { valueDecoder: Object.assign(Object.assign({}, defaultProps.valueDecoder), moduleParameters.valueDecoder), modelMatrix: getModelMatrix(this.props.rotDeg, this.props.bounds[0], // Rotate around upper left corner of bounds
70
- this.props.bounds[3]) });
71
- super.setModuleParameters(mergedModuleParams);
72
- const valueRangeMin = (_a = this.props.valueRange[0]) !== null && _a !== void 0 ? _a : 0.0;
73
- const valueRangeMax = (_b = this.props.valueRange[1]) !== null && _b !== void 0 ? _b : 1.0;
67
+ // Set property for modelMatrix.
68
+ const m = getModelMatrix(this.props.rotDeg, this.props.bounds[0], // Rotate around upper left corner of bounds
69
+ this.props.bounds[3]);
70
+ for (const model of this.getModels()) {
71
+ const isDefined = ((_b = (_a = props[0]) === null || _a === void 0 ? void 0 : _a.project) === null || _b === void 0 ? void 0 : _b.modelMatrix) !== undefined;
72
+ if (isDefined) {
73
+ props[0]["project"].modelMatrix =
74
+ m;
75
+ }
76
+ model.shaderInputs.setProps(...props);
77
+ }
78
+ // Properties for local shader module.
79
+ const valueRangeMin = (_c = this.props.valueRange[0]) !== null && _c !== void 0 ? _c : 0.0;
80
+ const valueRangeMax = (_d = this.props.valueRange[1]) !== null && _d !== void 0 ? _d : 1.0;
74
81
  // If specified color map will extend from colorMapRangeMin to colorMapRangeMax.
75
82
  // Otherwise it will extend from valueRangeMin to valueRangeMax.
76
- const colorMapRangeMin = (_d = (_c = this.props.colorMapRange) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : valueRangeMin;
77
- const colorMapRangeMax = (_f = (_e = this.props.colorMapRange) === null || _e === void 0 ? void 0 : _e[1]) !== null && _f !== void 0 ? _f : valueRangeMax;
83
+ const colorMapRangeMin = (_f = (_e = this.props.colorMapRange) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : valueRangeMin;
84
+ const colorMapRangeMax = (_h = (_g = this.props.colorMapRange) === null || _g === void 0 ? void 0 : _g[1]) !== null && _h !== void 0 ? _h : valueRangeMax;
78
85
  const colormap = this.context.device.createTexture({
79
86
  width: 256,
80
87
  height: 1,
81
88
  format: "rgb8unorm-webgl",
82
89
  data: getImageData(this.props.colorMapName, this.context.userData.colorTables, this.props.colorMapFunction),
83
90
  });
84
- (_g = this.state.model) === null || _g === void 0 ? void 0 : _g.setBindings({ colormap });
85
- super.draw({
86
- uniforms: Object.assign(Object.assign({}, uniforms), {
87
- // Send the colormap texture to the shader.
91
+ (_j = this.state.model) === null || _j === void 0 ? void 0 : _j.setBindings({ colormap });
92
+ super.setShaderModuleProps({
93
+ map: {
88
94
  valueRangeMin,
89
95
  valueRangeMax,
90
96
  colorMapRangeMin,
91
- colorMapRangeMax }),
92
- moduleParameters: mergedModuleParams,
97
+ colorMapRangeMax,
98
+ rgbScaler: this.props.valueDecoder.rgbScaler,
99
+ floatScaler: this.props.valueDecoder.floatScaler,
100
+ offset: this.props.valueDecoder.offset,
101
+ step: this.props.valueDecoder.step,
102
+ },
93
103
  });
94
104
  }
95
- // Signature from the base class, eslint doesn't like the any type.
96
- // eslint-disable-next-line
97
105
  getShaders() {
98
106
  const parentShaders = super.getShaders();
99
- // Overwrite the BitmapLayer's default fragment shader with ours, that does colormapping.
100
- parentShaders.fs = fsColormap;
101
- // Add the decoder shader module to our colormap shader, so we can use the decoder function from our shader.
102
- parentShaders.modules.push(decoder);
103
- return parentShaders;
107
+ // use object.assign to make sure we don't overwrite existing fields like `vs`, `modules`...
108
+ return Object.assign({}, parentShaders, {
109
+ fs: fsColormap,
110
+ modules: [...parentShaders.modules, project32, map2DUniforms],
111
+ });
104
112
  }
105
113
  getPickingInfo({ info, }) {
106
114
  if (!info.color) {
@@ -134,4 +142,52 @@ export default class ColormapLayer extends BitmapLayer {
134
142
  }
135
143
  ColormapLayer.layerName = "ColormapLayer";
136
144
  ColormapLayer.defaultProps = defaultProps;
145
+ // local shader module for the uniforms
146
+ const map2DUniformsBlock = /*glsl*/ `\
147
+ uniform mapUniforms {
148
+ float valueRangeMin;
149
+ float valueRangeMax;
150
+ float colorMapRangeMin;
151
+ float colorMapRangeMax;
152
+
153
+ vec3 rgbScaler; // r, g and b multipliers
154
+ float floatScaler; // value multiplier
155
+ float offset; // translation of the r, g, b sum
156
+ float step; // discretize the value in a number of
157
+ } map;
158
+
159
+ float decode_rgb2float(vec3 rgb) {
160
+ rgb *= map.rgbScaler * vec3(16711680.0, 65280.0, 255.0); //255*256*256, 255*256, 255
161
+ float value = (rgb.r + rgb.g + rgb.b + map.offset) * map.floatScaler;
162
+
163
+ // Value must be in [0, 1] and step in (0, 1]
164
+ if (map.step > 0.0) {
165
+ value = floor(value / map.step + 0.5) * map.step;
166
+ }
167
+
168
+ // If colorMapRangeMin/Max specified, color map will span this interval.
169
+ float x = value * (map.valueRangeMax - map.valueRangeMin) + map.valueRangeMin;
170
+ x = (x - map.colorMapRangeMin) / (map.colorMapRangeMax - map.colorMapRangeMin);
171
+ x = max(0.0, x);
172
+ x = min(1.0, x);
173
+
174
+ return x;
175
+ }
176
+ `;
177
+ // NOTE: this must exactly the same name as in the uniform block
178
+ const map2DUniforms = {
179
+ name: "map",
180
+ vs: map2DUniformsBlock,
181
+ fs: map2DUniformsBlock,
182
+ uniformTypes: {
183
+ valueRangeMin: "f32",
184
+ valueRangeMax: "f32",
185
+ colorMapRangeMin: "f32",
186
+ colorMapRangeMax: "f32",
187
+ rgbScaler: "vec3<f32>",
188
+ floatScaler: "f32",
189
+ offset: "f32",
190
+ step: "f32",
191
+ },
192
+ };
137
193
  //# sourceMappingURL=colormapLayer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colormapLayer.js","sourceRoot":"","sources":["../../../src/layers/colormap/colormapLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAO9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAM5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,SAAS,YAAY,CACjB,YAAoB,EACpB,WAA6B,EAC7B,gBAAuC;IAEvC,MAAM,yBAAyB,GAAG,OAAO,gBAAgB,KAAK,WAAW,CAAC;IAE1E,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;IAErC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC;QACxB,MAAM,GAAG,GAAG,yBAAyB;YACjC,CAAC,CAAE,gBAAyC,CAAC,CAAC,GAAG,GAAG,CAAC;YACrD,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;QACnD,IAAI,KAAK,GAAa,EAAE,CAAC;QACzB,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC;YACnB,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,KAAK,GAAG,GAAG,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACJ,KAAK,GAAG,CAAC,GAAG,CAAC,CAA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Aa,CAAC,YAAY,GAAG,YAAY,CAAC;AAE1C,uCAAuC;AACvC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BnC,CAAC;AAcF,gEAAgE;AAChE,MAAM,aAAa,GAAG;IAClB,IAAI,EAAE,KAAK;IACX,EAAE,EAAE,kBAAkB;IACtB,EAAE,EAAE,kBAAkB;IACtB,YAAY,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE,KAAK;QAEvB,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,KAAK;KACd;CAC2D,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\n\nflat in vec3 normal;\nflat in int vertexIndex;\nflat in float property;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nuniform float valueRangeMin;\nuniform float valueRangeMax;\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform bool isColoringDiscrete;\nuniform float colorMapSize;\n\nuniform vec4 colorMapClampColor;\nuniform bool isClampColor;\nuniform vec3 undefinedPropertyColor;\n\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 / colorMapSize) * 0.5;\n\n if (propertyValue < colorMapRangeMin - tolerance || propertyValue > colorMapRangeMax + tolerance) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = 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, colorMapRangeMin, colorMapRangeMax);\n float x = p / colorMapSize;\n color = texture(colormap, vec2(x + tolerance, 0.5));\n }\n }\n else {\n float x = propertyValue / 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 - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);\n if (normalizedValue < 0.0 || normalizedValue > 1.0) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = 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 = getPhongLightColor(undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\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, valueRangeMin, valueRangeMax);\n\n vec4 color = 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 = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
1
+ declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\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, 1.0);\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, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
2
2
  export default fsShader;
@@ -13,43 +13,30 @@ out vec4 fragColor;
13
13
 
14
14
  uniform sampler2D colormap;
15
15
 
16
- uniform float valueRangeMin;
17
- uniform float valueRangeMax;
18
- uniform float colorMapRangeMin;
19
- uniform float colorMapRangeMax;
20
-
21
- uniform bool isColoringDiscrete;
22
- uniform float colorMapSize;
23
-
24
- uniform vec4 colorMapClampColor;
25
- uniform bool isClampColor;
26
- uniform vec3 undefinedPropertyColor;
27
-
28
-
29
16
  // Calculate color from propertyValue using discrete colormap.
30
17
  vec4 getDiscretePropertyColor (float propertyValue) {
31
18
  vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
32
19
  // On some machines (like in docker container), float comparison and texture lookup may fail due to precision.
33
20
  // Use this tolerance for comparison and to shift the lookup position.
34
- float tolerance = (1.0 / colorMapSize) * 0.5;
21
+ float tolerance = (1.0 / grid.colorMapSize) * 0.5;
35
22
 
36
- if (propertyValue < colorMapRangeMin - tolerance || propertyValue > colorMapRangeMax + tolerance) {
23
+ if (propertyValue < grid.colorMapRangeMin - tolerance || propertyValue > grid.colorMapRangeMax + tolerance) {
37
24
  // Out of range. Use clampcolor.
38
- if (isClampColor) {
39
- color = colorMapClampColor;
25
+ if (grid.isClampColor) {
26
+ color = grid.colorMapClampColor;
40
27
  if( color[3] == 0.0 ) {
41
28
  discard;
42
29
  }
43
30
  }
44
31
  else {
45
32
  // Use min/max color to clamp.
46
- float p = clamp (propertyValue, colorMapRangeMin, colorMapRangeMax);
47
- float x = p / colorMapSize;
33
+ float p = clamp (propertyValue, grid.colorMapRangeMin, grid.colorMapRangeMax);
34
+ float x = p / grid.colorMapSize;
48
35
  color = texture(colormap, vec2(x + tolerance, 0.5));
49
36
  }
50
37
  }
51
38
  else {
52
- float x = propertyValue / colorMapSize;
39
+ float x = propertyValue / grid.colorMapSize;
53
40
  color = texture(colormap, vec2(x + tolerance, 0.5));
54
41
  }
55
42
 
@@ -58,11 +45,11 @@ vec4 getDiscretePropertyColor (float propertyValue) {
58
45
 
59
46
  vec4 getContinuousPropertyColor (float propertyValue) {
60
47
  vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
61
- float normalizedValue = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);
48
+ float normalizedValue = (propertyValue - grid.colorMapRangeMin) / (grid.colorMapRangeMax - grid.colorMapRangeMin);
62
49
  if (normalizedValue < 0.0 || normalizedValue > 1.0) {
63
50
  // Out of range. Use clampcolor.
64
- if (isClampColor) {
65
- color = colorMapClampColor;
51
+ if (grid.isClampColor) {
52
+ color = grid.colorMapClampColor;
66
53
  if( color[3] == 0.0 ) {
67
54
  discard;
68
55
  }
@@ -87,19 +74,19 @@ void main(void) {
87
74
  }
88
75
 
89
76
  if (isnan(property)) {
90
- vec3 lightColor = getPhongLightColor(undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);
77
+ vec3 lightColor = lighting_getLightColor(grid.undefinedPropertyColor.rgb, cameraPosition, position_commonspace.xyz, normal);
91
78
  fragColor = vec4(lightColor, 1.0);
92
79
  DECKGL_FILTER_COLOR(fragColor, geometry);
93
80
  return;
94
81
  }
95
82
 
96
83
  // This may happen due to GPU interpolation precision causing color artifacts.
97
- float propertyValue = clamp(property, valueRangeMin, valueRangeMax);
84
+ float propertyValue = clamp(property, grid.valueRangeMin, grid.valueRangeMax);
98
85
 
99
- vec4 color = isColoringDiscrete ? getDiscretePropertyColor(round(propertyValue)) : getContinuousPropertyColor(propertyValue);
86
+ vec4 color = grid.isColoringDiscrete ? getDiscretePropertyColor(round(propertyValue)) : getContinuousPropertyColor(propertyValue);
100
87
 
101
88
  // Use two sided phong lighting. This has no effect if "material" property is not set.
102
- vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
89
+ vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
103
90
  fragColor = vec4(lightColor, 1.0);
104
91
  DECKGL_FILTER_COLOR(fragColor, geometry);
105
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cellProperty.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/cellProperty.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyGhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"cellProperty.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/cellProperty.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const vsShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\nin float properties;\n\n// Outputs to fragment shader\nout vec3 cameraPosition;\nout vec4 position_commonspace;\n\nflat out vec3 normal;\nflat out int vertexIndex;\nflat out float property;\n\nuniform bool ZIncreasingDownwards;\n\nconst vec3 pickingColor = vec3(1.0, 1.0, 0.0);\n\nvoid main(void) { \n \n vertexIndex = gl_VertexID;\n cameraPosition = project_uCameraPosition; \n geometry.pickingColor = pickingColor;\n\n normal = normals;\n vec3 position = positions;\n\n float zSign = ZIncreasingDownwards ? -1.0 : 1.0;\n\n position.z *= zSign;\n normal.z *= zSign;\n\n property = properties;\n\n position_commonspace = vec4(project_position(position), 0.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
1
+ declare const vsShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\nin float properties;\n\n// Outputs to fragment shader\nout vec3 cameraPosition;\nout vec4 position_commonspace;\n\nflat out vec3 normal;\nflat out int vertexIndex;\nflat out float property;\n\nconst vec3 pickingColor = vec3(1.0, 1.0, 0.0);\n\nvoid main(void) { \n \n vertexIndex = gl_VertexID;\n cameraPosition = project.cameraPosition; \n geometry.pickingColor = pickingColor;\n\n normal = normals;\n vec3 position = positions;\n\n float zSign = grid.ZIncreasingDownwards ? -1.0 : 1.0;\n\n position.z *= zSign;\n normal.z *= zSign;\n\n property = properties;\n\n position_commonspace = vec4(project_position(position), 0.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
2
2
  export default vsShader;
@@ -14,20 +14,18 @@ flat out vec3 normal;
14
14
  flat out int vertexIndex;
15
15
  flat out float property;
16
16
 
17
- uniform bool ZIncreasingDownwards;
18
-
19
17
  const vec3 pickingColor = vec3(1.0, 1.0, 0.0);
20
18
 
21
19
  void main(void) {
22
20
 
23
21
  vertexIndex = gl_VertexID;
24
- cameraPosition = project_uCameraPosition;
22
+ cameraPosition = project.cameraPosition;
25
23
  geometry.pickingColor = pickingColor;
26
24
 
27
25
  normal = normals;
28
26
  vec3 position = positions;
29
27
 
30
- float zSign = ZIncreasingDownwards ? -1.0 : 1.0;
28
+ float zSign = grid.ZIncreasingDownwards ? -1.0 : 1.0;
31
29
 
32
30
  position.z *= zSign;
33
31
  normal.z *= zSign;
@@ -1 +1 @@
1
- {"version":3,"file":"cellProperty.vs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/cellProperty.vs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ChB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"cellProperty.vs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/cellProperty.vs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ChB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const fragmentShader = "#version 300 es\n#define SHADER_NAME graph-layer-fragment-shader\n\nprecision highp float;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vec4(0.0, 0.0, 0.0, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
1
+ declare const fragmentShader = "#version 300 es\n#define SHADER_NAME grid3d-cell-lines-fragment-shader\n\nprecision highp float;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vec4(0.0, 0.0, 0.0, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
2
2
  export default fragmentShader;
@@ -1,6 +1,6 @@
1
1
  const fragmentShader = `\
2
2
  #version 300 es
3
- #define SHADER_NAME graph-layer-fragment-shader
3
+ #define SHADER_NAME grid3d-cell-lines-fragment-shader
4
4
 
5
5
  precision highp float;
6
6
 
@@ -211,6 +211,7 @@ export default class Grid3DLayer extends CompositeLayer {
211
211
  }
212
212
  const undefinedColor = this.getUndefinedPropertyColor();
213
213
  const undefinedValue = this.getUndefinedPropertyValue();
214
+ const enableLighting = !(this.props.material === false);
214
215
  const layer = new PrivateLayer(this.getSubLayerProps({
215
216
  mesh: this.state["mesh"],
216
217
  meshLines: this.state["mesh_lines"],
@@ -228,6 +229,7 @@ export default class Grid3DLayer extends CompositeLayer {
228
229
  material: this.props.material,
229
230
  depthTest: this.props.depthTest,
230
231
  ZIncreasingDownwards: this.props.ZIncreasingDownwards,
232
+ enableLighting,
231
233
  }));
232
234
  return [layer];
233
235
  }
@@ -1 +1 @@
1
- {"version":3,"file":"grid3dLayer.js","sourceRoot":"","sources":["../../../src/layers/grid3d/grid3dLayer.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAShD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,kBAAkB;AAClB,MAAM,gBAAgB,GAAG,UAAU,CAC/B,MAAM,EACN,mBAAmB,EACnB,qCAAqC,CACxC,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,eACrB;IACC,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,KAAK;CACpB,EACE,gBAAgB,EACrB,CAAC;AAEH,SAAS,iBAAiB;IACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,IAAI,KAAK,CAAC,WAAW,KAAK,CAAC,IAAI,KAAK,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,SAAS,EAAE,C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OAAO,CACH,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,YAAY,UAAU,CAAC;YAC7D,SAAS,CAAC,MAAM,IAAI,CAAC,CACxB,CAAC;IACN,CAAC;CACJ;AAED,WAAW,CAAC,SAAS,GAAG,aAAa,CAAC;AACtC,WAAW,CAAC,YAAY,GAAG,YAA2C,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-node-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nin float property;\n\nflat in vec3 normal;\nflat in int vertexIndex;\n\nout vec4 fragColor;\n\nuniform sampler2D colormap;\n\nuniform float valueRangeMin;\nuniform float valueRangeMax;\nuniform float colorMapRangeMin;\nuniform float colorMapRangeMax;\n\nuniform vec4 colorMapClampColor;\nuniform bool isClampColor;\n\nvec4 getPropertyColor (float propertyValue) {\n vec4 color = vec4(1.0, 1.0, 1.0, 1.0);\n float normalizedValue = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);\n if (normalizedValue < 0.0 || normalizedValue > 1.0) {\n // Out of range. Use clampcolor.\n if (isClampColor) {\n color = 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, valueRangeMin, 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 = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
1
+ declare const fsShader = "#version 300 es\n#define SHADER_NAME grid3d-node-fragment-shader\n\nin vec3 cameraPosition;\nin vec4 position_commonspace;\nin float property;\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, 1.0);\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n";
2
2
  export default fsShader;
@@ -13,21 +13,13 @@ out vec4 fragColor;
13
13
 
14
14
  uniform sampler2D colormap;
15
15
 
16
- uniform float valueRangeMin;
17
- uniform float valueRangeMax;
18
- uniform float colorMapRangeMin;
19
- uniform float colorMapRangeMax;
20
-
21
- uniform vec4 colorMapClampColor;
22
- uniform bool isClampColor;
23
-
24
16
  vec4 getPropertyColor (float propertyValue) {
25
17
  vec4 color = vec4(1.0, 1.0, 1.0, 1.0);
26
- float normalizedValue = (propertyValue - colorMapRangeMin) / (colorMapRangeMax - colorMapRangeMin);
18
+ float normalizedValue = (propertyValue - grid.colorMapRangeMin) / (grid.colorMapRangeMax - grid.colorMapRangeMin);
27
19
  if (normalizedValue < 0.0 || normalizedValue > 1.0) {
28
20
  // Out of range. Use clampcolor.
29
- if (isClampColor) {
30
- color = colorMapClampColor;
21
+ if (grid.isClampColor) {
22
+ color = grid.colorMapClampColor;
31
23
  if( color[3] == 0.0 ) {
32
24
  discard;
33
25
  }
@@ -52,12 +44,12 @@ void main(void) {
52
44
  }
53
45
 
54
46
  // This may happen due to GPU interpolation precision causing color artifacts.
55
- float propertyValue = clamp(property, valueRangeMin, valueRangeMax);
47
+ float propertyValue = clamp(property, grid.valueRangeMin, grid.valueRangeMax);
56
48
 
57
49
  vec4 color = getPropertyColor(propertyValue);
58
50
 
59
51
  // Use two sided phong lighting. This has no effect if "material" property is not set.
60
- vec3 lightColor = getPhongLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
52
+ vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
61
53
  fragColor = vec4(lightColor, 1.0);
62
54
  DECKGL_FILTER_COLOR(fragColor, geometry);
63
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nodeProperty.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/nodeProperty.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"nodeProperty.fs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/nodeProperty.fs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,2 +1,2 @@
1
- declare const vsShader = "#version 300 es\n#define SHADER_NAME grid3d-node-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\n// Outputs to fragment shader\nout vec3 cameraPosition;\nout vec4 position_commonspace;\nout float property;\n\nflat out vec3 normal;\nflat out int vertexIndex;\n\nuniform lowp int coloringMode;\nuniform bool ZIncreasingDownwards;\n\nconst vec3 pickingColor = vec3(1.0, 1.0, 0.0);\n\nvoid main(void) { \n \n vertexIndex = gl_VertexID;\n cameraPosition = project_uCameraPosition; \n geometry.pickingColor = pickingColor;\n\n normal = normals;\n vec3 position = positions;\n\n float zSign = ZIncreasingDownwards ? -1.0 : 1.0;\n\n position.z *= zSign;\n normal.z *= zSign;\n\n switch(coloringMode) {\n case 2:\n property = position.x;\n break;\n case 3:\n property = position.y;\n break;\n case 4:\n property = position.z;\n break;\n // case 0 or default should never be used\n default:\n property = position.z;\n break;\n }\n\n position_commonspace = vec4(project_position(position), 0.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
1
+ declare const vsShader = "#version 300 es\n#define SHADER_NAME grid3d-node-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\n// Outputs to fragment shader\nout vec3 cameraPosition;\nout vec4 position_commonspace;\nout float property;\n\nflat out vec3 normal;\nflat out int vertexIndex;\n\nconst vec3 pickingColor = vec3(1.0, 1.0, 0.0);\n\nvoid main(void) { \n vertexIndex = gl_VertexID;\n cameraPosition = project.cameraPosition; \n geometry.pickingColor = pickingColor;\n\n normal = normals;\n vec3 position = positions;\n\n float zSign = grid.ZIncreasingDownwards ? -1.0 : 1.0;\n\n position.z *= zSign;\n normal.z *= zSign;\n\n switch(int(grid.coloringMode)) {\n case 2:\n property = position.x;\n break;\n case 3:\n property = position.y;\n break;\n case 4:\n property = position.z;\n break;\n // case 0 or default should never be used\n default:\n property = position.z;\n break;\n }\n\n position_commonspace = vec4(project_position(position), 0.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n";
2
2
  export default vsShader;
@@ -13,26 +13,22 @@ out float property;
13
13
  flat out vec3 normal;
14
14
  flat out int vertexIndex;
15
15
 
16
- uniform lowp int coloringMode;
17
- uniform bool ZIncreasingDownwards;
18
-
19
16
  const vec3 pickingColor = vec3(1.0, 1.0, 0.0);
20
17
 
21
18
  void main(void) {
22
-
23
19
  vertexIndex = gl_VertexID;
24
- cameraPosition = project_uCameraPosition;
20
+ cameraPosition = project.cameraPosition;
25
21
  geometry.pickingColor = pickingColor;
26
22
 
27
23
  normal = normals;
28
24
  vec3 position = positions;
29
25
 
30
- float zSign = ZIncreasingDownwards ? -1.0 : 1.0;
26
+ float zSign = grid.ZIncreasingDownwards ? -1.0 : 1.0;
31
27
 
32
28
  position.z *= zSign;
33
29
  normal.z *= zSign;
34
30
 
35
- switch(coloringMode) {
31
+ switch(int(grid.coloringMode)) {
36
32
  case 2:
37
33
  property = position.x;
38
34
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"nodeProperty.vs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/nodeProperty.vs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"nodeProperty.vs.glsl.js","sourceRoot":"","sources":["../../../src/layers/grid3d/nodeProperty.vs.glsl.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDhB,CAAC;AAEF,eAAe,QAAQ,CAAC"}