diff --git a/docs/developer-guide/custom-layers/composite-layers.md b/docs/developer-guide/custom-layers/composite-layers.md index a8f0a3fe287..6e7451c993a 100644 --- a/docs/developer-guide/custom-layers/composite-layers.md +++ b/docs/developer-guide/custom-layers/composite-layers.md @@ -173,7 +173,7 @@ class LabeledIconLayer extends CompositeLayer { ### Forwarding Properties -There are a number of base `Layer` class props that are usually expected to propogate down to all sublayers, such as `fp64`, `pickable`, `visible`, `coordinateSystem` and `opacity`. It is desirable to just forward many of these props directly to the sublayers. +There are a number of base `Layer` class props that are usually expected to propogate down to all sublayers, such as `pickable`, `visible`, `coordinateSystem` and `opacity`. It is desirable to just forward many of these props directly to the sublayers. There is a method `compositeLayer.getSubLayerProps` that handles a lot of these common compliance chore that were mentioned above. When calling it with a list of prop values that we care about, the list gets wrapped/populated with additional props that will help the sublayers align with deck.gl norms. diff --git a/docs/extensions/fp64-extension.md b/docs/extensions/fp64-extension.md new file mode 100644 index 00000000000..dd20dbd142f --- /dev/null +++ b/docs/extensions/fp64-extension.md @@ -0,0 +1,62 @@ + +# Fp64Extension + +The `Fp64Extension` adds 64-bit precision to geospatial layers. + +> Note: This extension is the equivalent of the `fp64` prop from older deck.gl versions. As of v6.3, the fp64 mode was deprecated in favor of the new default 32-bit projection mode that is comparable in precision but considerably more performant. + +```js +import {GeoJsonLayer} from '@deck.gl/layers'; +import {Fp64Extension} from '@deck.gl/extensions'; + +const layer = new GeoJsonLayer({ + id: 'geojson-layer', + data: GEOJSON, + ... + extensions: [new Fp64Extension()] +}); +``` + +## Installation + +To install the dependencies from NPM: + +```bash +npm install deck.gl +# or +npm install @deck.gl/core @deck.gl/layers @deck.gl/extensions +``` + +```js +import {Fp64Extension} from '@deck.gl/extensions'; +new Fp64Extension({}); +``` + +To use pre-bundled scripts: + +```html + + + + + +``` + +```js +new deck.Fp64Extension({}); +``` + +## Constructor + +```js +new Fp64Extension(); +``` + +## Layer Properties + +When added to a layer via the `extensions` prop, the `Fp64Extension` requires the `coordinateSystem` prop of the layer to be `COORDINATE_SYSTEM.LNGLAT_DEPRECATED`. + + +## Source + +[modules/extensions/src/fp64](https://github.com/uber/deck.gl/tree/master/modules/extensions/src/fp64) diff --git a/docs/layers/arc-layer.md b/docs/layers/arc-layer.md index 4366761f18f..8bcfd537873 100644 --- a/docs/layers/arc-layer.md +++ b/docs/layers/arc-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# ArcLayer @@ -88,12 +87,6 @@ Inherits from all [Base Layer](/docs/api-reference/layer.md) properties. ### Render Options -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `widthUnits` (String, optional) * Default: `'pixels'` diff --git a/docs/layers/bitmap-layer.md b/docs/layers/bitmap-layer.md index c08313dc857..5505995443b 100644 --- a/docs/layers/bitmap-layer.md +++ b/docs/layers/bitmap-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# BitmapLayer diff --git a/docs/layers/column-layer.md b/docs/layers/column-layer.md index bdfbe5f2de3..d5230e655f4 100644 --- a/docs/layers/column-layer.md +++ b/docs/layers/column-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit lighting

@@ -154,12 +153,6 @@ Whether to generate a line wireframe of the column. The outline will have "horizontal" lines closing the top and bottom polygons and a vertical line (a "strut") for each vertex around the disk. Only applies if `extruded: true`. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `lineWidthUnits` (String, optional) * Default: `'meters'` diff --git a/docs/layers/contour-layer.md b/docs/layers/contour-layer.md index 6e49388fa54..d7e40972234 100644 --- a/docs/layers/contour-layer.md +++ b/docs/layers/contour-layer.md @@ -2,7 +2,6 @@

@deck.gl/aggregation-layers - 64-bit

@@ -118,7 +117,7 @@ A very small z offset that is added for each vertex of a contour (Isoline or Iso * Default: `false` -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. +Whether the aggregation should be performed in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. ### Data Accessors diff --git a/docs/layers/cpu-grid-layer.md b/docs/layers/cpu-grid-layer.md index 4b0fa1cb192..479e41dc878 100644 --- a/docs/layers/cpu-grid-layer.md +++ b/docs/layers/cpu-grid-layer.md @@ -2,7 +2,6 @@

@deck.gl/aggregation-layers - 64-bit lighting

@@ -170,12 +169,6 @@ Filter cells and re-calculate elevation by `elevationLowerPercentile`. Cells wit smaller than the elevationLowerPercentile will be hidden. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `material` (Object, optional) * Default: `new PhongMaterial()` diff --git a/docs/layers/geojson-layer.md b/docs/layers/geojson-layer.md index c3e5ec0267f..b5a467a80f0 100644 --- a/docs/layers/geojson-layer.md +++ b/docs/layers/geojson-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit lighting

@@ -207,12 +206,6 @@ The maximum radius in pixels. Justify dashes together. Only works if `getLineDashArray` is specified. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `material` (Object, optional) * Default: `new PhongMaterial()` diff --git a/docs/layers/gpu-grid-layer.md b/docs/layers/gpu-grid-layer.md index 255126a36cb..557ce5d3436 100644 --- a/docs/layers/gpu-grid-layer.md +++ b/docs/layers/gpu-grid-layer.md @@ -2,7 +2,6 @@

@deck.gl/aggregation-layers - 64-bit lighting

@@ -142,7 +141,7 @@ Whether to enable cell elevation. Cell elevation scale by count of points in eac * Default: `false` -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. +Whether the aggregation should be performed in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. ##### `gpuAggregation` (bool, optional) diff --git a/docs/layers/grid-cell-layer.md b/docs/layers/grid-cell-layer.md index 2f5ba6bc1f0..78ca129219e 100644 --- a/docs/layers/grid-cell-layer.md +++ b/docs/layers/grid-cell-layer.md @@ -3,7 +3,6 @@

@deck.gl/layers - 64-bit lighting

@@ -114,12 +113,6 @@ to scale all cell elevations without updating the data. Whether to enable grid elevation. If set to false, all grid will be flat. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `material` (Object, optional) * Default: `new PhongMaterial()` diff --git a/docs/layers/grid-layer.md b/docs/layers/grid-layer.md index af9dc01f4a9..d9095ad47c7 100644 --- a/docs/layers/grid-layer.md +++ b/docs/layers/grid-layer.md @@ -2,8 +2,6 @@

@deck.gl/aggregation-layers - 64-bit - lighting

# GridLayer @@ -174,7 +172,7 @@ smaller than the elevationLowerPercentile will be hidden. * Default: `false` -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. +Whether the aggregation should be performed in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. ##### `gpuAggregation` (bool, optional) diff --git a/docs/layers/h3-cluster-layer.md b/docs/layers/h3-cluster-layer.md index 1beba5c9396..261bafd9af7 100644 --- a/docs/layers/h3-cluster-layer.md +++ b/docs/layers/h3-cluster-layer.md @@ -2,7 +2,6 @@

@deck.gl/geo-layers - 64-bit lighting

diff --git a/docs/layers/h3-hexagon-layer.md b/docs/layers/h3-hexagon-layer.md index fd00e662997..174188817ad 100644 --- a/docs/layers/h3-hexagon-layer.md +++ b/docs/layers/h3-hexagon-layer.md @@ -2,7 +2,6 @@

@deck.gl/geo-layers - 64-bit lighting

diff --git a/docs/layers/hexagon-layer.md b/docs/layers/hexagon-layer.md index 7ee1f911c9e..95ab9325ff9 100644 --- a/docs/layers/hexagon-layer.md +++ b/docs/layers/hexagon-layer.md @@ -2,7 +2,6 @@

@deck.gl/aggregation-layers - 64-bit lighting

@@ -187,12 +186,6 @@ larger than the elevationUpperPercentile will be hidden. Filter bins and re-calculate elevation by `elevationLowerPercentile`. Hexagons with elevation value smaller than the elevationLowerPercentile will be hidden. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `material` (Object, optional) * Default: `new PhongMaterial()` diff --git a/docs/layers/icon-layer.md b/docs/layers/icon-layer.md index 9f8389f55ee..0c252ce7fe6 100644 --- a/docs/layers/icon-layer.md +++ b/docs/layers/icon-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# IconLayer @@ -203,12 +202,6 @@ The minimum size in pixels. The maximum size in pixels. -##### `fp64` (Boolean, optional) - -- Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `billboard` (Boolean, optional) - Default: `true` diff --git a/docs/layers/line-layer.md b/docs/layers/line-layer.md index 36bd2e52fd0..c1bf540d55e 100644 --- a/docs/layers/line-layer.md +++ b/docs/layers/line-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# LineLayer @@ -89,12 +88,6 @@ Inherits from all [Base Layer](/docs/api-reference/layer.md) properties. The width used to draw each line. Unit is pixels. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `widthUnits` (String, optional) * Default: `'pixels'` diff --git a/docs/layers/path-layer.md b/docs/layers/path-layer.md index a04e8643cc7..e419ab52264 100644 --- a/docs/layers/path-layer.md +++ b/docs/layers/path-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# PathLayer @@ -125,12 +124,6 @@ If `false`, the width always faces up. The maximum extent of a joint in ratio to the stroke width. Only works if `rounded` is `false`. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `dashJustified` (Boolean, optional) * Default: `false` diff --git a/docs/layers/point-cloud-layer.md b/docs/layers/point-cloud-layer.md index f4910842768..4d40dafff87 100644 --- a/docs/layers/point-cloud-layer.md +++ b/docs/layers/point-cloud-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit lighting

@@ -92,12 +91,6 @@ The units of the point size, one of `'meters'`, `'pixels'`. When zooming in and Global radius of all points, in units specified by `sizeUnits` (default pixels). -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `material` (Object, optional) * Default: `new PhongMaterial()` diff --git a/docs/layers/polygon-layer.md b/docs/layers/polygon-layer.md index d31209df26a..3e33b400493 100644 --- a/docs/layers/polygon-layer.md +++ b/docs/layers/polygon-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit lighting

@@ -185,12 +184,6 @@ Only works if `lineJointRounded` is `false`. Justify dashes together. Only works if `getLineDashArray` is specified. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `material` (Object, optional) * Default: `new PhongMaterial()` diff --git a/docs/layers/s2-layer.md b/docs/layers/s2-layer.md index b543b30e02b..faa65d4a1b4 100644 --- a/docs/layers/s2-layer.md +++ b/docs/layers/s2-layer.md @@ -2,7 +2,6 @@

@deck.gl/geo-layers - 64-bit lighting

diff --git a/docs/layers/scatterplot-layer.md b/docs/layers/scatterplot-layer.md index 8d7019376ea..b03a65044a8 100644 --- a/docs/layers/scatterplot-layer.md +++ b/docs/layers/scatterplot-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# ScatterplotLayer @@ -139,12 +138,6 @@ The minimum line width in pixels. This prop can be used to prevent the stroke fr The maximum line width in pixels. This prop can be used to prevent the path from getting too thick when zoomed in. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ### Data Accessors ##### `getPosition` ([Function](/docs/developer-guide/using-layers.md#accessors), optional) ![transition-enabled](https://img.shields.io/badge/transition-enabled-green.svg?style=flat-square") diff --git a/docs/layers/scenegraph-layer.md b/docs/layers/scenegraph-layer.md index be0a294084a..52216c5e61a 100644 --- a/docs/layers/scenegraph-layer.md +++ b/docs/layers/scenegraph-layer.md @@ -93,12 +93,6 @@ Each value is an object with: - `speed`: number, `1` for default speed. Animations are parsed automatically from `glTF` files. Requires `_animate` on deck object. -##### `fp64` (Boolean, optional) - -- Default: `false` - -Not supported. Please do not use this option. - ##### `getScene` (Function, optional) - Default: `scenegraph => (scenegraph && scenegraph.scenes ? scenegraph.scenes[0] : scenegraph)` diff --git a/docs/layers/simple-mesh-layer.md b/docs/layers/simple-mesh-layer.md index 4a77628d738..2b7dfe2d3ba 100644 --- a/docs/layers/simple-mesh-layer.md +++ b/docs/layers/simple-mesh-layer.md @@ -1,6 +1,5 @@

@deck.gl/mesh-layers - 64-bit lighting

@@ -109,12 +108,6 @@ If `texture` is supplied, texture is used to render the geometries. Otherwise, o Multiplier to scale each geometry by. -##### `fp64` (Boolean, optional) - -- Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. - ##### `wireframe` (Boolean, optional) - Default: `false` diff --git a/docs/layers/solid-polygon-layer.md b/docs/layers/solid-polygon-layer.md index efb815805da..8c14d43ad95 100644 --- a/docs/layers/solid-polygon-layer.md +++ b/docs/layers/solid-polygon-layer.md @@ -1,6 +1,5 @@

@deck.gl/layers - 64-bit lighting

@@ -92,12 +91,6 @@ Elevation multiplier. The final elevation is calculated by `elevationScale * getElevation(d)`. `elevationScale` is a handy property to scale all elevation without updating the data. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - **Remarks:** * These lines are rendered with `GL.LINE` and will thus always be 1 pixel wide. diff --git a/docs/layers/text-layer.md b/docs/layers/text-layer.md index cb72d804d44..a8a418c5671 100644 --- a/docs/layers/text-layer.md +++ b/docs/layers/text-layer.md @@ -2,7 +2,6 @@

@deck.gl/layers - 64-bit

# TextLayer @@ -108,12 +107,6 @@ The minimum size in pixels. The maximum size in pixels. -##### `fp64` (Boolean, optional) - -* Default: `false` - -Whether the layer should be rendered in high-precision 64-bit mode. Note that since deck.gl v6.1, the default 32-bit projection uses a hybrid mode that matches 64-bit precision with significantly better performance. - ##### `billboard` (Boolean, optional) - Default: `true` diff --git a/docs/layers/tile-layer.md b/docs/layers/tile-layer.md index 2178757140d..766f12fb650 100644 --- a/docs/layers/tile-layer.md +++ b/docs/layers/tile-layer.md @@ -2,7 +2,6 @@

@deck.gl/geo-layers - 64-bit lighting

diff --git a/docs/layers/trips-layer.md b/docs/layers/trips-layer.md index 53529b49da2..17b2d5a9f44 100644 --- a/docs/layers/trips-layer.md +++ b/docs/layers/trips-layer.md @@ -1,7 +1,6 @@

@deck.gl/geo-layers - 64-bit

# Trips Layer diff --git a/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer.js b/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer.js index 6d8ef2b4d67..0574296378b 100644 --- a/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer.js +++ b/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer.js @@ -18,10 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer} from '@deck.gl/core'; +import {Layer, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, fp64} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, Geometry} from '@luma.gl/core'; import vs from './bezier-curve-layer-vertex.glsl'; import fs from './bezier-curve-layer-fragment.glsl'; @@ -31,7 +30,6 @@ const DEFAULT_COLOR = [0, 0, 0, 255]; const defaultProps = { strokeWidth: {type: 'number', min: 0, value: 1}, - fp64: false, getSourcePosition: {type: 'accessor', value: x => x.sourcePosition}, getTargetPosition: {type: 'accessor', value: x => x.targetPosition}, getControlPoint: {type: 'accessor', value: x => x.controlPoint}, @@ -74,21 +72,16 @@ export default class BezierCurveLayer extends Layer { /* eslint-enable max-len */ } - updateAttribute({props, oldProps, changeFlags}) { - if (props.fp64 !== oldProps.fp64) { - const {attributeManager} = this.state; - attributeManager.invalidateAll(); - } - } - updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; + if (this.state.model) { + this.state.model.delete(); + } this.setState({model: this._getModel(gl)}); } - this.updateAttribute({props, oldProps, changeFlags}); } draw({uniforms}) { diff --git a/examples/experimental/json-examples/geojson.json b/examples/experimental/json-examples/geojson.json index 1cde34a82d2..1ee3ea9951f 100644 --- a/examples/experimental/json-examples/geojson.json +++ b/examples/experimental/json-examples/geojson.json @@ -23,7 +23,6 @@ "filled": true, "extruded": true, "wireframe": true, - "fp64": true, "elevationScale": 0.10, "getElevation": "properties.valuePerSqm", "getFillColor": [199, 233, 180], diff --git a/examples/experimental/json-examples/line.json b/examples/experimental/json-examples/line.json index 324e211e98d..673492e82ba 100644 --- a/examples/experimental/json-examples/line.json +++ b/examples/experimental/json-examples/line.json @@ -31,7 +31,6 @@ "id": "flight-paths", "data": "https://raw.githubusercontent.com/uber-common/deck.gl-data/master/examples/line/heathrow-flights.json", "strokeWidth": 3, - "fp64": false, "getSourcePosition": "start", "getTargetPosition": "end", "getColor": [200, 32, 64, 192] diff --git a/examples/gallery/src/geojson-layer.html b/examples/gallery/src/geojson-layer.html index db0ea5b60de..5ecf3d5bd9c 100644 --- a/examples/gallery/src/geojson-layer.html +++ b/examples/gallery/src/geojson-layer.html @@ -63,7 +63,6 @@ filled: true, extruded: true, wireframe: true, - fp64: true, getElevation: f => Math.sqrt(f.properties.valuePerSqm) * 10, getFillColor: f => colorScale(f.properties.growth), diff --git a/examples/layer-browser/src/examples/core-layers.js b/examples/layer-browser/src/examples/core-layers.js index f48c4f46d03..fa74ea6c22b 100644 --- a/examples/layer-browser/src/examples/core-layers.js +++ b/examples/layer-browser/src/examples/core-layers.js @@ -141,8 +141,7 @@ const GeoJsonLayerExample = { getElevation: f => 500, lineWidthScale: 10, lineWidthMinPixels: 1, - pickable: true, - fp64: true + pickable: true } }; diff --git a/examples/layer-browser/src/examples/perf-layers.js b/examples/layer-browser/src/examples/perf-layers.js index 81a6fd8980a..92804c9f9ec 100644 --- a/examples/layer-browser/src/examples/perf-layers.js +++ b/examples/layer-browser/src/examples/perf-layers.js @@ -11,6 +11,8 @@ import { import {ScreenGridLayer} from '@deck.gl/aggregation-layers'; +import {Fp64Extension} from '@deck.gl/extensions'; + // Demonstrate immutable support import * as dataSamples from '../data-samples'; @@ -153,7 +155,7 @@ const ScatterplotLayer64PerfExample = (id, getData) => ({ // pickable: true, radiusMinPixels: 1, radiusMaxPixels: 5, - fp64: true + extensions: [new Fp64Extension()] } }); diff --git a/examples/website/geojson/app.js b/examples/website/geojson/app.js index 2341bff7ca3..6a50431bdfc 100644 --- a/examples/website/geojson/app.js +++ b/examples/website/geojson/app.js @@ -66,7 +66,6 @@ export class App extends Component { filled: true, extruded: true, wireframe: true, - fp64: true, getElevation: f => Math.sqrt(f.properties.valuePerSqm) * 10, getFillColor: f => COLOR_SCALE(f.properties.growth), getLineColor: [255, 255, 255], diff --git a/examples/website/line/app.js b/examples/website/line/app.js index 4ff40ec41a3..da5ff652035 100644 --- a/examples/website/line/app.js +++ b/examples/website/line/app.js @@ -89,7 +89,6 @@ export class App extends Component { new LineLayer({ id: 'flight-paths', data: flightPaths, - fp64: false, getSourcePosition: d => d.start, getTargetPosition: d => d.end, getColor, diff --git a/modules/aggregation-layers/src/contour-layer/contour-layer.js b/modules/aggregation-layers/src/contour-layer/contour-layer.js index f9fa2c0f28e..638ebba7ae1 100644 --- a/modules/aggregation-layers/src/contour-layer/contour-layer.js +++ b/modules/aggregation-layers/src/contour-layer/contour-layer.js @@ -174,13 +174,11 @@ export default class ContourLayer extends CompositeLayer { } _getLineLayerProps() { - const {fp64} = this.props; const {colorTrigger, strokeWidthTrigger} = this.state; return this.getSubLayerProps({ id: 'contour-line-layer', data: this.state.contourData.contourSegments, - fp64, getSourcePosition: d => d.start, getTargetPosition: d => d.end, getColor: this._onGetSublayerColor.bind(this), @@ -194,13 +192,11 @@ export default class ContourLayer extends CompositeLayer { } _getSolidPolygonLayerProps() { - const {fp64} = this.props; const {colorTrigger} = this.state; return this.getSubLayerProps({ id: 'contour-solid-polygon-layer', data: this.state.contourData.contourPolygons, - fp64, getPolygon: d => d.vertices, getFillColor: this._onGetSublayerColor.bind(this), updateTriggers: { diff --git a/modules/aggregation-layers/src/cpu-grid-layer/cpu-grid-layer.js b/modules/aggregation-layers/src/cpu-grid-layer/cpu-grid-layer.js index 5d323eea789..9bbaf8d5acd 100644 --- a/modules/aggregation-layers/src/cpu-grid-layer/cpu-grid-layer.js +++ b/modules/aggregation-layers/src/cpu-grid-layer/cpu-grid-layer.js @@ -58,7 +58,6 @@ const defaultProps = { coverage: {type: 'number', min: 0, max: 1, value: 1}, getPosition: {type: 'accessor', value: x => x.position}, extruded: false, - fp64: false, // Optional material for 'lighting' shader module material: defaultMaterial @@ -360,13 +359,12 @@ export default class CPUGridLayer extends CompositeLayer { } renderLayers() { - const {elevationScale, fp64, extruded, cellSize, coverage, material, transitions} = this.props; + const {elevationScale, extruded, cellSize, coverage, material, transitions} = this.props; const SubLayerClass = this.getSubLayerClass('grid-cell', GridCellLayer); return new SubLayerClass( { - fp64, cellSize, coverage, material, diff --git a/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer.js b/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer.js index 4827a4fa352..7030c74df4f 100644 --- a/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer.js +++ b/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer.js @@ -18,10 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer} from '@deck.gl/core'; +import {Layer, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, CubeGeometry, fp64, PhongMaterial} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, CubeGeometry, PhongMaterial, fp64 as fp64ShaderModule} from '@luma.gl/core'; const defaultMaterial = new PhongMaterial(); import {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils'; @@ -50,7 +49,7 @@ const defaultProps = { offset: {type: 'array', min: 0, value: [1, 1]}, coverage: {type: 'number', min: 0, max: 1, value: 1}, extruded: true, - fp64: false, + material: defaultMaterial }; @@ -59,7 +58,7 @@ export default class GPUGridCellLayer extends Layer { return super.getShaders({ vs, fs, - modules: ['project32', 'gouraud-lighting', 'picking', 'fp64'] + modules: ['project32', 'gouraud-lighting', 'picking', fp64ShaderModule] }); } diff --git a/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-layer.js b/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-layer.js index 4e4269318f2..0019bffc10c 100644 --- a/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-layer.js +++ b/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-layer.js @@ -247,7 +247,6 @@ export default class GPUGridLayer extends CompositeLayer { } const { elevationScale, - fp64, extruded, cellSize: cellSizeMeters, coverage, @@ -273,7 +272,6 @@ export default class GPUGridLayer extends CompositeLayer { colorDomain, elevationDomain, - fp64, cellSize: cellSizeMeters, coverage, material, diff --git a/modules/aggregation-layers/src/hexagon-layer/hexagon-layer.js b/modules/aggregation-layers/src/hexagon-layer/hexagon-layer.js index 1601595615d..29f0c38f4b0 100644 --- a/modules/aggregation-layers/src/hexagon-layer/hexagon-layer.js +++ b/modules/aggregation-layers/src/hexagon-layer/hexagon-layer.js @@ -60,7 +60,6 @@ const defaultProps = { extruded: false, hexagonAggregator: pointToHexbin, getPosition: {type: 'accessor', value: x => x.position}, - fp64: false, // Optional material for 'lighting' shader module material: defaultMaterial }; @@ -394,14 +393,13 @@ export default class HexagonLayer extends CompositeLayer { } renderLayers() { - const {elevationScale, extruded, coverage, material, fp64, transitions} = this.props; + const {elevationScale, extruded, coverage, material, transitions} = this.props; const {angle, radius} = this.state; const SubLayerClass = this.getSubLayerClass('hexagon-cell', ColumnLayer); return new SubLayerClass( { - fp64, radius, diskResolution: 6, elevationScale, diff --git a/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js b/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js index 53188ebb58a..78fe3d563e3 100644 --- a/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js +++ b/modules/aggregation-layers/src/utils/gpu-grid-aggregation/gpu-grid-aggregator.js @@ -7,12 +7,12 @@ import { hasFeatures, isWebGL2, readPixelsToBuffer, - fp64 as fp64Utils, + fp64 as fp64ShaderModule, withParameters } from '@luma.gl/core'; -import {log} from '@deck.gl/core'; +import {log, project64} from '@deck.gl/core'; import {worldToPixels} from 'viewport-mercator-project'; -const {fp64ifyMatrix4} = fp64Utils; +const {fp64ifyMatrix4} = fp64ShaderModule; import { DEFAULT_CHANGE_FLAGS, @@ -683,7 +683,7 @@ export default class GPUGridAggregator { id: 'Gird-Aggregation-Model', vs: fp64 ? AGGREGATE_TO_GRID_VS_FP64 : AGGREGATE_TO_GRID_VS, fs: AGGREGATE_TO_GRID_FS, - modules: fp64 ? ['fp64', 'project64'] : ['project32'], + modules: fp64 ? [project64] : ['project32'], shaderCache, vertexCount: 0, drawMode: GL.POINTS @@ -697,7 +697,7 @@ export default class GPUGridAggregator { id: 'All-Aggregation-Model', vs: AGGREGATE_ALL_VS_FP64, fs: AGGREGATE_ALL_FS, - modules: ['fp64'], + modules: [fp64ShaderModule], shaderCache, vertexCount: 1, drawMode: GL.POINTS, diff --git a/modules/core/src/index.js b/modules/core/src/index.js index 69688a1e90f..6e05d0d4183 100644 --- a/modules/core/src/index.js +++ b/modules/core/src/index.js @@ -87,6 +87,7 @@ export {default as log} from './utils/log'; import {flattenVertices, fillArray} from './utils/flatten'; // Export? move to luma.gl or math.gl? export {createIterable} from './utils/iterable-utils'; +export {fp64LowPart} from './utils/math-utils'; import Tesselator from './utils/tesselator'; // Export? move to luma.gl or math.gl? import {count} from './utils/count'; import memoize from './utils/memoize'; diff --git a/modules/core/src/lib/layer.js b/modules/core/src/lib/layer.js index 24f7446604d..46d312f7729 100644 --- a/modules/core/src/lib/layer.js +++ b/modules/core/src/lib/layer.js @@ -228,24 +228,8 @@ export default class Layer extends Component { return viewport.unprojectFlat(xy); } - use64bitProjection() { - if (this.props.fp64) { - if (this.props.coordinateSystem === COORDINATE_SYSTEM.LNGLAT_DEPRECATED) { - return true; - } - log.once( - 0, - `Legacy 64-bit mode only works with coordinateSystem set to - COORDINATE_SYSTEM.LNGLAT_DEPRECATED. Rendering in 32-bit mode instead` - )(); - } - - return false; - } - use64bitPositions() { return ( - this.props.fp64 || this.props.coordinateSystem === COORDINATE_SYSTEM.LNGLAT || this.props.coordinateSystem === COORDINATE_SYSTEM.IDENTITY ); @@ -607,7 +591,12 @@ export default class Layer extends Component { this.state.attributeManager = this.getAttributeManager(); // initializeState callback tends to clear state - this.setChangeFlags({dataChanged: true, propsChanged: true, viewportChanged: true}); + this.setChangeFlags({ + dataChanged: true, + propsChanged: true, + viewportChanged: true, + extensionsChanged: true + }); this._updateState(); diff --git a/modules/core/src/shaderlib/index.js b/modules/core/src/shaderlib/index.js index 0e8e4a835e8..5834f409079 100644 --- a/modules/core/src/shaderlib/index.js +++ b/modules/core/src/shaderlib/index.js @@ -24,23 +24,14 @@ import { createShaderHook, createModuleInjection } from '@luma.gl/core'; -import {fp32, fp64, picking, gouraudlighting, phonglighting} from '@luma.gl/core'; +import {fp32, picking, gouraudlighting, phonglighting} from '@luma.gl/core'; import geometry from './misc/geometry'; import project from './project/project'; import project32 from './project32/project32'; import project64 from './project64/project64'; export function initializeShaderModules() { - registerShaderModules([ - fp32, - fp64, - project, - project32, - project64, - gouraudlighting, - phonglighting, - picking - ]); + registerShaderModules([fp32, project, project32, gouraudlighting, phonglighting, picking]); setDefaultShaderModules([geometry, project]); @@ -62,4 +53,4 @@ export function initializeShaderModules() { }); } -export {fp32, fp64, picking, project, project64, gouraudlighting, phonglighting}; +export {picking, project, project64, gouraudlighting, phonglighting}; diff --git a/modules/core/src/shaderlib/project/viewport-uniforms.js b/modules/core/src/shaderlib/project/viewport-uniforms.js index e70aa1ec3ba..e6e5488e790 100644 --- a/modules/core/src/shaderlib/project/viewport-uniforms.js +++ b/modules/core/src/shaderlib/project/viewport-uniforms.js @@ -44,7 +44,6 @@ const getMemoizedViewportUniforms = memoize(calculateViewportUniforms); function getShaderCoordinateSystem(coordinateSystem) { switch (coordinateSystem) { case COORDINATE_SYSTEM.LNGLAT: - case COORDINATE_SYSTEM.LNGLAT_EXPERIMENTAL: default: return PROJECT_COORDINATE_SYSTEM.LNGLAT_AUTO_OFFSET; diff --git a/modules/core/src/utils/math-utils.js b/modules/core/src/utils/math-utils.js index d9682571e5b..d9af3bae57f 100644 --- a/modules/core/src/utils/math-utils.js +++ b/modules/core/src/utils/math-utils.js @@ -99,6 +99,15 @@ export function getFrustumPlanes({aspect, near, far, fovyRadians, position, dire return planes; } +/** + * Calculate the low part of a WebGL 64 bit float + * @param a {number} - the input float number + * @returns {number} - the lower 32 bit of the number + */ +export function fp64LowPart(x) { + return x - Math.fround(x); +} + // export function mod(value, divisor) { // assert(Number.isFinite(value) && Number.isFinite(divisor)); // const modulus = value % divisor; diff --git a/modules/core/src/utils/shader.js b/modules/core/src/utils/shader.js index 4a753d2e99d..069025cae9c 100644 --- a/modules/core/src/utils/shader.js +++ b/modules/core/src/utils/shader.js @@ -30,6 +30,16 @@ export function mergeShaders(target, source) { } if ('modules' in source) { result.modules = (target.modules || []).concat(source.modules); + + // Hack: prject32 and project64 cannot co-exist + if (source.modules.some(module => module === 'project64' || module.name === 'project64')) { + const index = result.modules.findIndex( + module => module === 'project32' || module.name === 'project32' + ); + if (index >= 0) { + result.modules.splice(index, 1); + } + } } if ('inject' in source) { result.inject = Object.assign({}, target.inject, source.inject); diff --git a/modules/extensions/src/fp64/fp64.js b/modules/extensions/src/fp64/fp64.js new file mode 100644 index 00000000000..440309f0889 --- /dev/null +++ b/modules/extensions/src/fp64/fp64.js @@ -0,0 +1,35 @@ +// Copyright (c) 2015 - 2017 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import {LayerExtension, COORDINATE_SYSTEM, project64} from '@deck.gl/core'; + +export default class Fp64Extension extends LayerExtension { + getShaders(opts) { + if (this.props.coordinateSystem !== COORDINATE_SYSTEM.LNGLAT_DEPRECATED) { + throw new Error('fp64: coordinateSystem must be LNGLAT_DEPRECATED'); + } + + return { + modules: [project64] + }; + } +} + +Fp64Extension.extensionName = 'Fp64Extension'; diff --git a/modules/extensions/src/index.js b/modules/extensions/src/index.js index 25922c6c265..b862b76a291 100644 --- a/modules/extensions/src/index.js +++ b/modules/extensions/src/index.js @@ -1 +1,2 @@ export {default as DataFilterExtension} from './data-filter/data-filter'; +export {default as Fp64Extension} from './fp64/fp64'; diff --git a/modules/geo-layers/src/h3-layers/h3-cluster-layer.js b/modules/geo-layers/src/h3-layers/h3-cluster-layer.js index 5f39c6f92f0..514d5b72e29 100644 --- a/modules/geo-layers/src/h3-layers/h3-cluster-layer.js +++ b/modules/geo-layers/src/h3-layers/h3-cluster-layer.js @@ -66,7 +66,6 @@ export default class H3ClusterLayer extends CompositeLayer { lineJointRounded, lineMiterLimit, lineDashJustified, - fp64, material, getFillColor, @@ -81,7 +80,6 @@ export default class H3ClusterLayer extends CompositeLayer { return new SubLayerClass( { - fp64, filled, wireframe, diff --git a/modules/geo-layers/src/h3-layers/h3-hexagon-layer.js b/modules/geo-layers/src/h3-layers/h3-hexagon-layer.js index c71cd1b7054..4fbc7cb6baf 100644 --- a/modules/geo-layers/src/h3-layers/h3-hexagon-layer.js +++ b/modules/geo-layers/src/h3-layers/h3-hexagon-layer.js @@ -177,7 +177,6 @@ export default class H3HexagonLayer extends CompositeLayer { _getForwardProps() { const { elevationScale, - fp64, material, coverage, extruded, @@ -199,7 +198,6 @@ export default class H3HexagonLayer extends CompositeLayer { return { elevationScale, - fp64, extruded, coverage, wireframe, diff --git a/modules/geo-layers/src/s2-layer/s2-layer.js b/modules/geo-layers/src/s2-layer/s2-layer.js index 85c1a211628..446d87899fb 100644 --- a/modules/geo-layers/src/s2-layer/s2-layer.js +++ b/modules/geo-layers/src/s2-layer/s2-layer.js @@ -49,7 +49,6 @@ export default class S2Layer extends CompositeLayer { lineJointRounded, lineMiterLimit, lineDashJustified, - fp64, getElevation, getFillColor, getLineColor, @@ -64,7 +63,6 @@ export default class S2Layer extends CompositeLayer { const CellLayer = this.getSubLayerClass('cell', PolygonLayer); return new CellLayer( { - fp64, filled, wireframe, diff --git a/modules/layers/src/arc-layer/arc-layer-vertex-64.glsl.js b/modules/layers/src/arc-layer/arc-layer-vertex-64.glsl.js deleted file mode 100644 index fb8a1d25ad3..00000000000 --- a/modules/layers/src/arc-layer/arc-layer-vertex-64.glsl.js +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2015 - 2017 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default `\ -#define SHADER_NAME arc-layer-vertex-shader-64 - -attribute vec3 positions; -attribute vec4 instanceSourceColors; -attribute vec4 instanceTargetColors; - -attribute vec4 instancePositions; -attribute vec4 instancePositions64Low; - -attribute vec3 instancePickingColors; -attribute float instanceWidths; - -uniform float numSegments; -uniform float opacity; -uniform float widthScale; -uniform float widthMinPixels; -uniform float widthMaxPixels; - -varying vec4 vColor; -varying vec2 uv; - -vec2 paraboloid_fp64(vec2 source[2], vec2 target[2], float ratio) { - - vec2 x[2]; - vec2_mix_fp64(source, target, ratio, x); - vec2 center[2]; - vec2_mix_fp64(source, target, 0.5, center); - - vec2 dSourceCenter = vec2_distance_fp64(source, center); - vec2 dXCenter = vec2_distance_fp64(x, center); - return mul_fp64(sum_fp64(dSourceCenter, dXCenter), sub_fp64(dSourceCenter, dXCenter)); -} - -// offset vector by strokeWidth pixels -// offset_direction is -1 (left) or 1 (right) -vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { - // normalized direction of the line - vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize); - // rotate by 90 degrees - dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); - - return dir_screenspace * offset_direction * width / 2.0; -} - -float getSegmentRatio(float index) { - return smoothstep(0.0, 1.0, index / (numSegments - 1.0)); -} - -void get_pos_fp64(vec2 source[2], vec2 target[2], float segmentRatio, out vec2 position[4]) { - - vec2 vertex_height = paraboloid_fp64(source, target, segmentRatio); - - vec2 position_temp[2]; - - vec2_mix_fp64(source, target, segmentRatio, position_temp); - - position[0] = position_temp[0]; - position[1] = position_temp[1]; - - if (vertex_height.x < 0.0 || (vertex_height.x == 0.0 && vertex_height.y <= 0.0)) { - vertex_height = vec2(0.0, 0.0); - } - - position[2] = sqrt_fp64(vertex_height); - position[3] = vec2(1.0, 0.0); -} - -void main(void) { - geometry.worldPosition = vec3(instancePositions.xy, 0.0); - geometry.worldPositionAlt = vec3(instancePositions.zw, 0.0); - - vec2 projected_source_coord[2]; - vec2 projected_target_coord[2]; - - project_position_fp64(instancePositions.xy, instancePositions64Low.xy, projected_source_coord); - project_position_fp64(instancePositions.zw, instancePositions64Low.zw, projected_target_coord); - - float segmentIndex = positions.x; - float segmentRatio = getSegmentRatio(segmentIndex); - - // if it's the first point, use next - current as direction - // otherwise use current - prev - float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); - float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); - - vec2 curr_pos_modelspace[4]; - - get_pos_fp64(projected_source_coord, projected_target_coord, segmentRatio, - curr_pos_modelspace); - - vec2 next_pos_modelspace[4]; - - get_pos_fp64(projected_source_coord, projected_target_coord, nextSegmentRatio, - next_pos_modelspace); - - vec4 curr_pos_clipspace = project_common_position_to_clipspace_fp64(curr_pos_modelspace); - vec4 next_pos_clipspace = project_common_position_to_clipspace_fp64(next_pos_modelspace); - geometry.position = vec4(curr_pos_modelspace[0].x, curr_pos_modelspace[1].x, curr_pos_modelspace[2].x, 1.0); - uv = positions.xy; - geometry.uv = uv; - - // Multiply out width and clamp to limits - // mercator pixels are interpreted as screen pixels - float widthPixels = clamp( - project_size_to_pixel(instanceWidths * widthScale), - widthMinPixels, widthMaxPixels - ); - - vec3 offset = vec3( - getExtrusionOffset(next_pos_clipspace.xy - curr_pos_clipspace.xy, positions.y, widthPixels), - 0.0); - DECKGL_FILTER_SIZE(offset, geometry); - - gl_Position = curr_pos_clipspace + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0); - DECKGL_FILTER_GL_POSITION(gl_Position, geometry); - - vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio) / 255.; - vColor = vec4(color.rgb, color.a * opacity); - DECKGL_FILTER_COLOR(vColor, geometry); - - // Set color to be rendered to picking fbo (also used to check for selection highlight). - picking_setPickingColor(instancePickingColors); -} -`; diff --git a/modules/layers/src/arc-layer/arc-layer.js b/modules/layers/src/arc-layer/arc-layer.js index 2966e0d7de5..06b43479253 100644 --- a/modules/layers/src/arc-layer/arc-layer.js +++ b/modules/layers/src/arc-layer/arc-layer.js @@ -18,21 +18,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, fp64} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, Geometry} from '@luma.gl/core'; import vs from './arc-layer-vertex.glsl'; -import vs64 from './arc-layer-vertex-64.glsl'; import fs from './arc-layer-fragment.glsl'; const DEFAULT_COLOR = [0, 0, 0, 255]; const defaultProps = { - fp64: false, - getSourcePosition: {type: 'accessor', value: x => x.sourcePosition}, getTargetPosition: {type: 'accessor', value: x => x.targetPosition}, getSourceColor: {type: 'accessor', value: DEFAULT_COLOR}, @@ -52,11 +48,7 @@ const defaultProps = { export default class ArcLayer extends Layer { getShaders() { - return super.getShaders( - this.use64bitProjection() - ? {vs: vs64, fs, modules: ['project64', 'picking']} - : {vs, fs, modules: ['picking']} - ); // 'project' module added by default. + return super.getShaders({vs, fs, modules: ['picking']}); // 'project' module added by default. } initializeState() { @@ -114,7 +106,7 @@ export default class ArcLayer extends Layer { updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); // Re-generate model if geometry changed - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/bitmap-layer/bitmap-layer.js b/modules/layers/src/bitmap-layer/bitmap-layer.js index 35a3153ff54..483aeab75bd 100644 --- a/modules/layers/src/bitmap-layer/bitmap-layer.js +++ b/modules/layers/src/bitmap-layer/bitmap-layer.js @@ -20,10 +20,8 @@ /* global Image, HTMLCanvasElement, HTMLVideoElement */ import GL from '@luma.gl/constants'; -import {Layer} from '@deck.gl/core'; -import {Model, Geometry, Texture2D, fp64} from '@luma.gl/core'; - -const {fp64LowPart} = fp64; +import {Layer, fp64LowPart} from '@deck.gl/core'; +import {Model, Geometry, Texture2D} from '@luma.gl/core'; import vs from './bitmap-layer-vertex'; import fs from './bitmap-layer-fragment'; @@ -38,7 +36,6 @@ const DEFAULT_TEXTURE_PARAMETERS = { const defaultProps = { image: {type: 'object', value: null, async: true}, bounds: {type: 'array', value: [1, 0, 0, 1], compare: true}, - fp64: false, desaturate: {type: 'number', min: 0, max: 1, value: 0}, // More context: because of the blending mode we're using for ground imagery, @@ -56,8 +53,7 @@ const defaultProps = { */ export default class BitmapLayer extends Layer { getShaders() { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; - return super.getShaders({vs, fs, modules: [projectModule, 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'picking']}); } initializeState() { @@ -81,7 +77,7 @@ export default class BitmapLayer extends Layer { updateState({props, oldProps, changeFlags}) { // setup model first - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/column-layer/column-layer.js b/modules/layers/src/column-layer/column-layer.js index 4247da85239..33c478eb186 100644 --- a/modules/layers/src/column-layer/column-layer.js +++ b/modules/layers/src/column-layer/column-layer.js @@ -18,11 +18,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, fp64, PhongMaterial} from '@luma.gl/core'; +import {Model, PhongMaterial} from '@luma.gl/core'; import ColumnGeometry from './column-geometry'; -const {fp64LowPart} = fp64; const defaultMaterial = new PhongMaterial(); import vs from './column-layer-vertex.glsl'; @@ -45,7 +44,6 @@ const defaultProps = { lineWidthMaxPixels: Number.MAX_SAFE_INTEGER, extruded: true, - fp64: false, wireframe: false, filled: true, stroked: false, @@ -61,8 +59,7 @@ const defaultProps = { export default class ColumnLayer extends Layer { getShaders() { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; - return super.getShaders({vs, fs, modules: [projectModule, 'gouraud-lighting', 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'gouraud-lighting', 'picking']}); } /** @@ -114,7 +111,7 @@ export default class ColumnLayer extends Layer { updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); - const regenerateModels = props.fp64 !== oldProps.fp64; + const regenerateModels = changeFlags.extensionsChanged; if (regenerateModels) { const {gl} = this.context; diff --git a/modules/layers/src/geojson-layer/geojson-layer.js b/modules/layers/src/geojson-layer/geojson-layer.js index 4feb1b9b15e..2eddda7eb74 100644 --- a/modules/layers/src/geojson-layer/geojson-layer.js +++ b/modules/layers/src/geojson-layer/geojson-layer.js @@ -57,7 +57,6 @@ const defaultProps = { pointRadiusMaxPixels: Number.MAX_SAFE_INTEGER, // max point radius in pixels lineDashJustified: false, - fp64: false, // Line and polygon outline color getLineColor: {type: 'accessor', value: defaultLineColor}, @@ -167,8 +166,7 @@ export default class GeoJsonLayer extends CompositeLayer { pointRadiusMinPixels, pointRadiusMaxPixels, elevationScale, - lineDashJustified, - fp64 + lineDashJustified } = this.props; // Accessor props for underlying layers @@ -194,7 +192,6 @@ export default class GeoJsonLayer extends CompositeLayer { { _dataDiff: featuresDiff.polygonFeatures && (() => featuresDiff.polygonFeatures), - fp64, extruded, elevationScale, filled, @@ -234,7 +231,6 @@ export default class GeoJsonLayer extends CompositeLayer { _dataDiff: featuresDiff.polygonOutlineFeatures && (() => featuresDiff.polygonOutlineFeatures), - fp64, widthUnits: lineWidthUnits, widthScale: lineWidthScale, widthMinPixels: lineWidthMinPixels, @@ -273,7 +269,6 @@ export default class GeoJsonLayer extends CompositeLayer { { _dataDiff: featuresDiff.lineFeatures && (() => featuresDiff.lineFeatures), - fp64, widthUnits: lineWidthUnits, widthScale: lineWidthScale, widthMinPixels: lineWidthMinPixels, @@ -312,7 +307,6 @@ export default class GeoJsonLayer extends CompositeLayer { { _dataDiff: featuresDiff.pointFeatures && (() => featuresDiff.pointFeatures), - fp64, stroked, filled, radiusScale: pointRadiusScale, diff --git a/modules/layers/src/icon-layer/icon-layer.js b/modules/layers/src/icon-layer/icon-layer.js index f544c6bbd1d..f24aa6b0cd3 100644 --- a/modules/layers/src/icon-layer/icon-layer.js +++ b/modules/layers/src/icon-layer/icon-layer.js @@ -17,11 +17,9 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, fp64} from '@luma.gl/core'; - -const {fp64LowPart} = fp64; +import {Model, Geometry} from '@luma.gl/core'; import vs from './icon-layer-vertex.glsl'; import fs from './icon-layer-fragment.glsl'; @@ -55,7 +53,6 @@ const defaultProps = { iconAtlas: {type: 'object', value: null, async: true}, iconMapping: {type: 'object', value: {}, async: true}, sizeScale: {type: 'number', value: 1, min: 0}, - fp64: false, billboard: true, sizeUnits: 'pixels', sizeMinPixels: {type: 'number', min: 0, value: 0}, // min point radius in pixels @@ -70,8 +67,7 @@ const defaultProps = { export default class IconLayer extends Layer { getShaders() { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; - return super.getShaders({vs, fs, modules: [projectModule, 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'picking']}); } initializeState() { @@ -164,7 +160,7 @@ export default class IconLayer extends Layer { attributeManager.invalidate('instanceColorModes'); } - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/line-layer/line-layer.js b/modules/layers/src/line-layer/line-layer.js index fe88732c5ff..01007d3e1de 100644 --- a/modules/layers/src/line-layer/line-layer.js +++ b/modules/layers/src/line-layer/line-layer.js @@ -18,10 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, fp64} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, Geometry} from '@luma.gl/core'; import vs from './line-layer-vertex.glsl'; import fs from './line-layer-fragment.glsl'; @@ -29,8 +28,6 @@ import fs from './line-layer-fragment.glsl'; const DEFAULT_COLOR = [0, 0, 0, 255]; const defaultProps = { - fp64: false, - getSourcePosition: {type: 'accessor', value: x => x.sourcePosition}, getTargetPosition: {type: 'accessor', value: x => x.targetPosition}, getColor: {type: 'accessor', value: DEFAULT_COLOR}, @@ -47,8 +44,7 @@ const defaultProps = { export default class LineLayer extends Layer { getShaders() { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; - return super.getShaders({vs, fs, modules: [projectModule, 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'picking']}); } initializeState() { @@ -91,7 +87,7 @@ export default class LineLayer extends Layer { updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/path-layer/path-layer-vertex-64.glsl.js b/modules/layers/src/path-layer/path-layer-vertex-64.glsl.js deleted file mode 100644 index 81f469e5333..00000000000 --- a/modules/layers/src/path-layer/path-layer-vertex-64.glsl.js +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) 2015 - 2017 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default `\ - -#define SHADER_NAME path-layer-vertex-shader-64 - -attribute vec3 positions; - -attribute float instanceTypes; -attribute vec3 instanceStartPositions; -attribute vec3 instanceEndPositions; -attribute vec3 instanceLeftPositions; -attribute vec3 instanceRightPositions; -attribute vec4 instanceLeftStartPositions64xyLow; -attribute vec4 instanceEndRightPositions64xyLow; -attribute float instanceStrokeWidths; -attribute vec4 instanceColors; -attribute vec3 instancePickingColors; -attribute vec2 instanceDashArrays; - -uniform float widthScale; -uniform float widthMinPixels; -uniform float widthMaxPixels; -uniform float jointType; -uniform float miterLimit; - -uniform float opacity; - -varying vec4 vColor; -varying vec2 vCornerOffset; -varying float vMiterLength; -varying vec2 vDashArray; -varying vec2 vPathPosition; -varying float vPathLength; - -const float EPSILON = 0.001; - -float flipIfTrue(bool flag) { - return -(float(flag) * 2. - 1.); -} - -vec3 lineJoin(vec2 prevPoint64[2], vec2 currPoint64[2], vec2 nextPoint64[2]) { - - float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale), - widthMinPixels, widthMaxPixels) / 2.0; - float width = project_pixel_size(widthPixels); - - vec2 deltaA64[2]; - vec2 deltaB64[2]; - - vec2_sub_fp64(currPoint64, prevPoint64, deltaA64); - vec2_sub_fp64(nextPoint64, currPoint64, deltaB64); - - vec2 lengthA64 = vec2_length_fp64(deltaA64); - vec2 lengthB64 = vec2_length_fp64(deltaB64); - - vec2 deltaA = vec2(deltaA64[0].x, deltaA64[1].x); - vec2 deltaB = vec2(deltaB64[0].x, deltaB64[1].x); - - float lenA = lengthA64.x; - float lenB = lengthB64.x; - - vec2 offsetVec; - float offsetScale; - float offsetDirection; - - // when two points are closer than PIXEL_EPSILON in pixels, - // assume they are the same point to avoid precision issue - lenA = lenA / width > EPSILON ? lenA : 0.0; - lenB = lenB / width > EPSILON ? lenB : 0.0; - vec2 dirA = lenA > 0. ? deltaA / lenA : vec2(0.0, 0.0); - vec2 dirB = lenB > 0. ? deltaB / lenB : vec2(0.0, 0.0); - - vec2 perpA = vec2(-dirA.y, dirA.x); - vec2 perpB = vec2(-dirB.y, dirB.x); - - // tangent of the corner - vec2 tangent = vec2(dirA + dirB); - tangent = length(tangent) > 0. ? normalize(tangent) : perpA; - // direction of the corner - vec2 miterVec = vec2(-tangent.y, tangent.x); - // width offset from current position - vec2 perp = mix(perpB, perpA, positions.x); - float L = mix(lenB, lenA, positions.x); - - // cap super sharp angles - float sinHalfA = abs(dot(miterVec, perp)); - float cosHalfA = abs(dot(dirA, miterVec)); - bool turnsRight = dirA.x * dirB.y > dirA.y * dirB.x; - - // relative position to the corner: - // -1: inside (smaller side of the angle) - // 0: center - // 1: outside (bigger side of the angle) - float cornerPosition = mix( - flipIfTrue(turnsRight == (positions.y > 0.0)), - 0.0, - positions.z - ); - - offsetScale = 1.0 / max(sinHalfA, EPSILON); - - // do not bevel if line segment is too short - cornerPosition *= float(cornerPosition <= 0.0 || sinHalfA < min(lenA, lenB) / width * cosHalfA); - // trim if inside corner extends further than the line segment - offsetScale = mix( - offsetScale, - min(offsetScale, L / width / max(cosHalfA, EPSILON)), - float(cornerPosition < 0.0) - ); - - vMiterLength = mix( - offsetScale * cornerPosition, - mix(offsetScale, 0.0, cornerPosition), - step(0.0, cornerPosition) - ) - sinHalfA * jointType; - offsetDirection = mix( - positions.y, - mix( - flipIfTrue(turnsRight), - positions.y * flipIfTrue(turnsRight == (positions.x == 1.)), - cornerPosition - ), - step(0.0, cornerPosition) - ); - offsetVec = mix(miterVec, -tangent, step(0.5, cornerPosition)); - offsetScale = mix(offsetScale, 1.0 / max(cosHalfA, 0.001), step(0.5, cornerPosition)); - - // special treatment for start cap and end cap - // using a small number as the limit for determining if the lenA or lenB is 0 - float isEnd = positions.x; - float isStartCap = isEnd * float(instanceTypes == 1.0 || instanceTypes == 3.0); - float isEndCap = (1.0 - isEnd) * float(instanceTypes == 2.0 || instanceTypes == 3.0); - float isCap = max(isStartCap, isEndCap); - - // 0: center, 1: side - cornerPosition = isCap * (1.0 - positions.z); - - // start of path: use next - curr - offsetVec = mix(offsetVec, mix(dirB, perpB, cornerPosition), isStartCap); - // end of path: use curr - prev - offsetVec = mix(offsetVec, mix(dirA, perpA, cornerPosition), isEndCap); - - // extend out a triangle to envelope the round cap - offsetScale = mix( - offsetScale, - mix(4.0 * jointType, 1.0, cornerPosition), - isCap - ); - vMiterLength = mix(vMiterLength, 1.0 - cornerPosition, isCap); - - offsetDirection = mix( - offsetDirection, - mix(flipIfTrue(isStartCap > 0.), positions.y, cornerPosition), - isCap - ); - - vCornerOffset = offsetVec * offsetDirection * offsetScale; - - // Generate variables for dash calculation - vDashArray = instanceDashArrays; - vPathLength = L / width; - vec2 offsetFromStartOfPath = mix(vCornerOffset, vCornerOffset + deltaA / width, isEnd); - vec2 dir = mix(dirB, dirA, isEnd); - vPathPosition = vec2( - positions.y + positions.z * offsetDirection, - dot(offsetFromStartOfPath, dir) - ); - geometry.uv = vPathPosition; - - float isValid = step(instanceTypes, 3.5); - return vec3(vCornerOffset * width * isValid, 0.0); -} - -void main() { - geometry.worldPosition = instanceStartPositions; - geometry.worldPositionAlt = instanceEndPositions; - - vColor = vec4(instanceColors.rgb, instanceColors.a * opacity) / 255.; - - // Set color to be rendered to picking fbo (also used to check for selection highlight). - picking_setPickingColor(instancePickingColors); - - float isEnd = positions.x; - - // Calculate current position 64bit - - vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd); - vec2 currPosition64xyLow = mix(instanceLeftStartPositions64xyLow.zw, instanceEndRightPositions64xyLow.xy, isEnd); - vec2 projected_curr_position[2]; - project_position_fp64(currPosition.xy, currPosition64xyLow, projected_curr_position); - float projected_curr_position_z = project_size(currPosition.z); - - // Calculate previous position - - vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd); - vec2 prevPosition64xyLow = mix(instanceLeftStartPositions64xyLow.xy, instanceLeftStartPositions64xyLow.zw, isEnd); - - // Calculate prev position 64bit - - vec2 projected_prev_position[2]; - project_position_fp64(prevPosition.xy, prevPosition64xyLow, projected_prev_position); - - // Calculate next positions - vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd); - vec2 nextPosition64xyLow = mix(instanceEndRightPositions64xyLow.xy, instanceEndRightPositions64xyLow.zw, isEnd); - - // Calculate next position 64bit - - vec2 projected_next_position[2]; - project_position_fp64(nextPosition.xy, nextPosition64xyLow, projected_next_position); - - vec3 pos = lineJoin(projected_prev_position, projected_curr_position, projected_next_position); - DECKGL_FILTER_SIZE(pos, geometry); - vec2 vertex_pos_modelspace[4]; - - vertex_pos_modelspace[0] = sum_fp64(vec2(pos.x, 0.0), projected_curr_position[0]); - vertex_pos_modelspace[1] = sum_fp64(vec2(pos.y, 0.0), projected_curr_position[1]); - vertex_pos_modelspace[2] = vec2(pos.z + projected_curr_position_z, 0.0); - vertex_pos_modelspace[3] = vec2(1.0, 0.0); - - geometry.position = vec4(vertex_pos_modelspace[0].x, vertex_pos_modelspace[1].x, vertex_pos_modelspace[2].x, 1.0); - - gl_Position = project_common_position_to_clipspace_fp64(vertex_pos_modelspace); - DECKGL_FILTER_GL_POSITION(gl_Position, geometry); - DECKGL_FILTER_COLOR(vColor, geometry); -} -`; diff --git a/modules/layers/src/path-layer/path-layer.js b/modules/layers/src/path-layer/path-layer.js index 04709ebadc4..85907e0f5dc 100644 --- a/modules/layers/src/path-layer/path-layer.js +++ b/modules/layers/src/path-layer/path-layer.js @@ -25,7 +25,6 @@ import {Model, Geometry} from '@luma.gl/core'; import PathTesselator from './path-tesselator'; import vs from './path-layer-vertex.glsl'; -import vs64 from './path-layer-vertex-64.glsl'; import fs from './path-layer-fragment.glsl'; const DEFAULT_COLOR = [0, 0, 0, 255]; @@ -37,7 +36,6 @@ const defaultProps = { widthMaxPixels: {type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER}, // max stroke width in pixels rounded: false, miterLimit: {type: 'number', min: 0, value: 4}, - fp64: false, dashJustified: false, billboard: false, @@ -55,11 +53,7 @@ const ATTRIBUTE_TRANSITION = { export default class PathLayer extends Layer { getShaders() { - return super.getShaders( - this.use64bitProjection() - ? {vs: vs64, fs, modules: ['project64', 'picking']} - : {vs, fs, modules: ['project32', 'picking']} - ); // 'project' module added by default. + return super.getShaders({vs, fs, modules: ['project32', 'picking']}); // 'project' module added by default. } initializeState() { @@ -152,7 +146,6 @@ export default class PathLayer extends Layer { const geometryChanged = changeFlags.dataChanged || - props.fp64 !== oldProps.fp64 || (changeFlags.updateTriggersChanged && (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getPath)); @@ -176,7 +169,7 @@ export default class PathLayer extends Layer { } } - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/path-layer/path-tesselator.js b/modules/layers/src/path-layer/path-tesselator.js index 3476cfb7d5b..7e4329d6317 100644 --- a/modules/layers/src/path-layer/path-tesselator.js +++ b/modules/layers/src/path-layer/path-tesselator.js @@ -17,10 +17,8 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {experimental} from '@deck.gl/core'; +import {experimental, fp64LowPart} from '@deck.gl/core'; const {Tesselator} = experimental; -import {fp64 as fp64Module} from '@luma.gl/core'; -const {fp64LowPart} = fp64Module; const START_CAP = 1; const END_CAP = 2; diff --git a/modules/layers/src/point-cloud-layer/point-cloud-layer.js b/modules/layers/src/point-cloud-layer/point-cloud-layer.js index d05d6887839..a3f01115751 100644 --- a/modules/layers/src/point-cloud-layer/point-cloud-layer.js +++ b/modules/layers/src/point-cloud-layer/point-cloud-layer.js @@ -18,10 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, fp64, PhongMaterial} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, Geometry, PhongMaterial} from '@luma.gl/core'; import vs from './point-cloud-layer-vertex.glsl'; import fs from './point-cloud-layer-fragment.glsl'; @@ -33,7 +32,6 @@ const defaultMaterial = new PhongMaterial(); const defaultProps = { sizeUnits: 'pixels', pointSize: {type: 'number', min: 0, value: 10}, // point radius in pixels - fp64: false, getPosition: {type: 'accessor', value: x => x.position}, getNormal: {type: 'accessor', value: DEFAULT_NORMAL}, @@ -47,8 +45,7 @@ const defaultProps = { export default class PointCloudLayer extends Layer { getShaders(id) { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; - return super.getShaders({vs, fs, modules: [projectModule, 'gouraud-lighting', 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'gouraud-lighting', 'picking']}); } initializeState() { @@ -83,7 +80,7 @@ export default class PointCloudLayer extends Layer { updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/polygon-layer/polygon-layer.js b/modules/layers/src/polygon-layer/polygon-layer.js index fdfeab36c91..8eae6619cbf 100644 --- a/modules/layers/src/polygon-layer/polygon-layer.js +++ b/modules/layers/src/polygon-layer/polygon-layer.js @@ -43,7 +43,6 @@ const defaultProps = { lineJointRounded: false, lineMiterLimit: 4, lineDashJustified: false, - fp64: false, getPolygon: {type: 'accessor', value: f => f.polygon}, // Polygon fill color @@ -165,8 +164,7 @@ export default class PolygonLayer extends CompositeLayer { lineWidthMaxPixels, lineJointRounded, lineMiterLimit, - lineDashJustified, - fp64 + lineDashJustified } = this.props; // Accessor props for underlying layers @@ -195,7 +193,6 @@ export default class PolygonLayer extends CompositeLayer { extruded, elevationScale, - fp64, filled, wireframe, @@ -229,7 +226,6 @@ export default class PolygonLayer extends CompositeLayer { new StrokeLayer( { _dataDiff: pathsDiff && (() => pathsDiff), - fp64, widthUnits: lineWidthUnits, widthScale: lineWidthScale, widthMinPixels: lineWidthMinPixels, diff --git a/modules/layers/src/scatterplot-layer/scatterplot-layer.js b/modules/layers/src/scatterplot-layer/scatterplot-layer.js index 2b44fc141bd..2d2ea734896 100644 --- a/modules/layers/src/scatterplot-layer/scatterplot-layer.js +++ b/modules/layers/src/scatterplot-layer/scatterplot-layer.js @@ -18,10 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, fp64} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, Geometry} from '@luma.gl/core'; import vs from './scatterplot-layer-vertex.glsl'; import fs from './scatterplot-layer-fragment.glsl'; @@ -39,7 +38,6 @@ const defaultProps = { lineWidthMaxPixels: {type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER}, stroked: false, - fp64: false, filled: true, getPosition: {type: 'accessor', value: x => x.position}, @@ -56,8 +54,7 @@ const defaultProps = { export default class ScatterplotLayer extends Layer { getShaders(id) { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; - return super.getShaders({vs, fs, modules: [projectModule, 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'picking']}); } initializeState() { @@ -103,7 +100,7 @@ export default class ScatterplotLayer extends Layer { updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); - if (props.fp64 !== oldProps.fp64) { + if (changeFlags.extensionsChanged) { const {gl} = this.context; if (this.state.model) { this.state.model.delete(); diff --git a/modules/layers/src/solid-polygon-layer/polygon-tesselator.js b/modules/layers/src/solid-polygon-layer/polygon-tesselator.js index e3318c06843..834bddbb873 100644 --- a/modules/layers/src/solid-polygon-layer/polygon-tesselator.js +++ b/modules/layers/src/solid-polygon-layer/polygon-tesselator.js @@ -24,10 +24,8 @@ // - 3D surfaces (top and sides only) // - 3D wireframes (not yet) import * as Polygon from './polygon'; -import {experimental} from '@deck.gl/core'; +import {experimental, fp64LowPart} from '@deck.gl/core'; const {Tesselator} = experimental; -import {fp64 as fp64Module} from '@luma.gl/core'; -const {fp64LowPart} = fp64Module; // This class is set up to allow querying one attribute at a time // the way the AttributeManager expects it diff --git a/modules/layers/src/solid-polygon-layer/solid-polygon-layer.js b/modules/layers/src/solid-polygon-layer/solid-polygon-layer.js index bd6e22e0fca..605135ee490 100644 --- a/modules/layers/src/solid-polygon-layer/solid-polygon-layer.js +++ b/modules/layers/src/solid-polygon-layer/solid-polygon-layer.js @@ -38,7 +38,6 @@ const defaultProps = { extruded: false, // Whether to draw a GL.LINES wireframe of the polygon wireframe: false, - fp64: false, // elevation multiplier elevationScale: {type: 'number', min: 0, value: 1}, @@ -63,12 +62,11 @@ const ATTRIBUTE_TRANSITION = { export default class SolidPolygonLayer extends Layer { getShaders(vs) { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; return super.getShaders({ vs, fs, defines: {}, - modules: [projectModule, 'gouraud-lighting', 'picking'] + modules: ['project32', 'gouraud-lighting', 'picking'] }); } @@ -232,11 +230,11 @@ export default class SolidPolygonLayer extends Layer { this.updateGeometry(updateParams); - const {props, oldProps} = updateParams; + const {props, oldProps, changeFlags} = updateParams; const attributeManager = this.getAttributeManager(); const regenerateModels = - props.fp64 !== oldProps.fp64 || + changeFlags.extensionsChanged || props.filled !== oldProps.filled || props.extruded !== oldProps.extruded; @@ -253,7 +251,6 @@ export default class SolidPolygonLayer extends Layer { updateGeometry({props, oldProps, changeFlags}) { const geometryConfigChanged = changeFlags.dataChanged || - props.fp64 !== oldProps.fp64 || (changeFlags.updateTriggersChanged && (changeFlags.updateTriggersChanged.all || changeFlags.updateTriggersChanged.getPolygon)); diff --git a/modules/layers/src/text-layer/text-layer.js b/modules/layers/src/text-layer/text-layer.js index 45656f4cd48..3456947265d 100644 --- a/modules/layers/src/text-layer/text-layer.js +++ b/modules/layers/src/text-layer/text-layer.js @@ -57,7 +57,6 @@ const MISSING_CHAR_WIDTH = 32; const FONT_SETTINGS_PROPS = ['fontSize', 'buffer', 'sdf', 'radius', 'cutoff']; const defaultProps = { - fp64: false, billboard: true, sizeScale: 1, sizeUnits: 'pixels', @@ -287,7 +286,6 @@ export default class TextLayer extends CompositeLayer { getTextAnchor, getAlignmentBaseline, getPixelOffset, - fp64, billboard, sdf, sizeScale, @@ -315,7 +313,6 @@ export default class TextLayer extends CompositeLayer { getAnchorX: this.getAnchorXFromTextAnchor(getTextAnchor), getAnchorY: this.getAnchorYFromAlignmentBaseline(getAlignmentBaseline), getPixelOffset: this._getAccessor(getPixelOffset), - fp64, billboard, sizeScale: sizeScale * scale, sizeUnits, diff --git a/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.js b/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.js index dbe58fd6130..e9a497c2f46 100644 --- a/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.js +++ b/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.js @@ -18,8 +18,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; -import {fp64, ScenegraphNode, isWebGL2, pbr, log} from '@luma.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; +import {ScenegraphNode, isWebGL2, pbr, log} from '@luma.gl/core'; import {createGLTFObjects} from '@luma.gl/addons'; import {waitForGLTFAssets} from './gltf-utils'; @@ -28,8 +28,6 @@ import {MATRIX_ATTRIBUTES} from '../utils/matrix'; import vs from './scenegraph-layer-vertex.glsl'; import fs from './scenegraph-layer-fragment.glsl'; -const {fp64LowPart} = fp64; - const DEFAULT_COLOR = [255, 255, 255, 255]; const defaultProps = { diff --git a/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer.js b/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer.js index 5d981ff6ab2..57c6b7cdb23 100644 --- a/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer.js +++ b/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer.js @@ -22,10 +22,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {Layer, createIterable} from '@deck.gl/core'; +import {Layer, createIterable, fp64LowPart} from '@deck.gl/core'; import GL from '@luma.gl/constants'; -import {Model, Geometry, Texture2D, fp64, PhongMaterial, isWebGL2} from '@luma.gl/core'; -const {fp64LowPart} = fp64; +import {Model, Geometry, Texture2D, PhongMaterial, isWebGL2} from '@luma.gl/core'; import {MATRIX_ATTRIBUTES} from '../utils/matrix'; @@ -93,7 +92,7 @@ const defaultProps = { depthTest: true, depthFunc: GL.LEQUAL }, - fp64: false, + // NOTE(Tarek): Quick and dirty wireframe. Just draws // the same mesh with LINE_STRIPS. Won't follow edges // of the original mesh. @@ -115,12 +114,11 @@ const defaultProps = { export default class SimpleMeshLayer extends Layer { getShaders() { - const projectModule = this.use64bitProjection() ? 'project64' : 'project32'; const gl2 = isWebGL2(this.context.gl); const vs = gl2 ? vs3 : vs1; const fs = gl2 ? fs3 : fs1; - return super.getShaders({vs, fs, modules: [projectModule, 'phong-lighting', 'picking']}); + return super.getShaders({vs, fs, modules: ['project32', 'phong-lighting', 'picking']}); } initializeState() { @@ -160,7 +158,7 @@ export default class SimpleMeshLayer extends Layer { updateState({props, oldProps, changeFlags}) { super.updateState({props, oldProps, changeFlags}); - if (props.mesh !== oldProps.mesh || props.fp64 !== oldProps.fp64) { + if (props.mesh !== oldProps.mesh || changeFlags.extensionsChanged) { if (this.state.model) { this.state.model.delete(); } diff --git a/test/modules/aggregation-layers/gpu-grid-layer/webgl1-spies-utils.js b/test/modules/aggregation-layers/gpu-grid-layer/webgl1-spies-utils.js index 6f5e51e6e98..3bd338ef316 100644 --- a/test/modules/aggregation-layers/gpu-grid-layer/webgl1-spies-utils.js +++ b/test/modules/aggregation-layers/gpu-grid-layer/webgl1-spies-utils.js @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import {isWebGL2} from '@luma.gl/core'; +import {isWebGL2, fp64 as fp64ShaderModule} from '@luma.gl/core'; import {_GPUGridAggregator as GPUGridAggregator} from '@deck.gl/aggregation-layers'; import GPUGridCellLayer from '@deck.gl/aggregation-layers/gpu-grid-layer/gpu-grid-cell-layer'; import {makeSpy} from '@probe.gl/test-utils'; @@ -42,7 +42,7 @@ export function setupSpysForWebGL1(gl) { getShadersSpy.returns({ vs: VS, fs: FS, - modules: ['project32', 'gouraud-lighting', 'picking', 'fp64'] + modules: ['project32', 'gouraud-lighting', 'picking', fp64ShaderModule] }); isSupportedSpy.returns(true); setupUniformBufferSpy.returns(null); diff --git a/test/modules/core/lib/layer.spec.js b/test/modules/core/lib/layer.spec.js index ddd666ed454..e34a1c1f139 100644 --- a/test/modules/core/lib/layer.spec.js +++ b/test/modules/core/lib/layer.spec.js @@ -256,22 +256,6 @@ test('Layer#diffProps', t => { t.end(); }); -test('Layer#use64bitProjection', t => { - let layer = new SubLayer({}); - t.false(layer.use64bitProjection(), 'returns false for fp64: false'); - - layer = new SubLayer({fp64: true}); - t.false(layer.use64bitProjection(), 'returns false for default mode'); - - layer = new SubLayer({coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS, fp64: true}); - t.false(layer.use64bitProjection(), 'returns false for default mode'); - - layer = new SubLayer({coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, fp64: true}); - t.true(layer.use64bitProjection(), 'returns true for legacy lnglat mode'); - - t.end(); -}); - test('Layer#use64bitPositions', t => { let layer = new SubLayer({}); t.true(layer.use64bitPositions(), 'returns true for default settings'); diff --git a/test/modules/core/shaderlib/project/project-glsl-test-utils.js b/test/modules/core/shaderlib/project/project-glsl-test-utils.js index d989b1c769e..073d75a1ac8 100644 --- a/test/modules/core/shaderlib/project/project-glsl-test-utils.js +++ b/test/modules/core/shaderlib/project/project-glsl-test-utils.js @@ -20,6 +20,7 @@ import {equals} from 'math.gl'; import {Transform} from '@luma.gl/core'; +import {project64} from '@deck.gl/core'; export function getPixelOffset(p1, p2) { return [p1[0] - p2[0], p1[1] - p2[1], p1[2] - p2[2], 1]; @@ -42,7 +43,7 @@ export function runOnGPU({ elementCount, usefp64 = true }) { - const modules = usefp64 ? ['project64'] : ['project32']; + const modules = usefp64 ? [project64] : ['project32']; // const modules = usefp64 ? ['project64'] : []; const transform = new Transform(gl, { // TODO: remove sourceBuffers after https://github.com/uber/luma.gl/pull/733 diff --git a/test/modules/extensions/fp64.spec.js b/test/modules/extensions/fp64.spec.js new file mode 100644 index 00000000000..7200b5b79d2 --- /dev/null +++ b/test/modules/extensions/fp64.spec.js @@ -0,0 +1,34 @@ +import test from 'tape-catch'; +import {Fp64Extension} from '@deck.gl/extensions'; +import {COORDINATE_SYSTEM} from '@deck.gl/core'; +import {ScatterplotLayer} from '@deck.gl/layers'; +import {testLayer} from '@deck.gl/test-utils'; + +test('Fp64Extension', t => { + const testCases = [ + { + props: { + id: 'fp64-test', + data: [ + {position: [-122.453, 37.782], timestamp: 120, entry: 13567, exit: 4802}, + {position: [-122.454, 37.781], timestamp: 140, entry: 14475, exit: 5493} + ], + getPosition: d => d.position + } + }, + { + updateProps: { + coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, + extensions: [new Fp64Extension()] + }, + onAfterUpdate: ({layer}) => { + const {uniforms} = layer.state.model.program; + t.ok(uniforms.project_uViewProjectionMatrixFP64, 'has fp64 uniforms'); + } + } + ]; + + testLayer({Layer: ScatterplotLayer, testCases, onError: t.notOk}); + + t.end(); +}); diff --git a/test/modules/extensions/index.js b/test/modules/extensions/index.js index db3877511c8..e87fe1a888e 100644 --- a/test/modules/extensions/index.js +++ b/test/modules/extensions/index.js @@ -1 +1,2 @@ import './data-filter.spec'; +import './fp64.spec'; diff --git a/test/render/golden-images/arc-lnglat-64.png b/test/render/golden-images/arc-lnglat-64.png deleted file mode 100644 index 11e4648340f..00000000000 Binary files a/test/render/golden-images/arc-lnglat-64.png and /dev/null differ diff --git a/test/render/golden-images/line-lnglat-64.png b/test/render/golden-images/line-lnglat-64.png deleted file mode 100644 index b54c885e412..00000000000 Binary files a/test/render/golden-images/line-lnglat-64.png and /dev/null differ diff --git a/test/render/golden-images/path-outline-64.png b/test/render/golden-images/path-outline-64.png deleted file mode 100644 index a4ed96d21a0..00000000000 Binary files a/test/render/golden-images/path-outline-64.png and /dev/null differ diff --git a/test/render/test-cases.js b/test/render/test-cases.js index af03de37f86..76b3439724b 100644 --- a/test/render/test-cases.js +++ b/test/render/test-cases.js @@ -16,6 +16,8 @@ import { } from '@deck.gl/core'; import {noise, vignette} from '@luma.gl/effects'; +import {Fp64Extension} from '@deck.gl/extensions'; + const effect1 = new PostProcessEffect(noise); const effect2 = new PostProcessEffect(vignette); @@ -379,31 +381,6 @@ export const TEST_CASES = [ ], goldenImage: './test/render/golden-images/path-lnglat.png' }, - { - name: 'path-lnglat-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11.5, - pitch: 0, - bearing: 0 - }, - layers: [ - new PathLayer({ - id: 'path-lnglat-64', - data: dataSamples.zigzag, - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, - opacity: 0.6, - getPath: f => f.path, - getColor: f => [128, 0, 0], - getWidth: f => 100, - widthMinPixels: 1, - pickable: true - }) - ], - goldenImage: './test/render/golden-images/path-lnglat.png' - }, { name: 'path-billboard', viewState: { @@ -462,10 +439,9 @@ export const TEST_CASES = [ }, layers: [ new ScatterplotLayer({ - id: 'scatterplot-lnglat-64', + id: 'scatterplot-lnglat', data: dataSamples.points, coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, getPosition: d => d.COORDINATES, getFillColor: d => [255, 128, 0], getRadius: d => d.SPACES, @@ -473,7 +449,8 @@ export const TEST_CASES = [ pickable: true, radiusScale: 30, radiusMinPixels: 1, - radiusMaxPixels: 30 + radiusMaxPixels: 30, + extensions: [new Fp64Extension()] }) ], goldenImage: './test/render/golden-images/scatterplot-lnglat.png' @@ -504,34 +481,6 @@ export const TEST_CASES = [ threshold: 0.985 } }, - { - name: 'arc-lnglat-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11.5, - pitch: 20, - bearing: 0 - }, - layers: [ - new ArcLayer({ - id: 'arc-lnglat-64', - data: dataSamples.routes, - strokeWidth: 2, - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, - getSourcePosition: d => d.START, - getTargetPosition: d => d.END, - getSourceColor: d => [64, 255, 0], - getTargetColor: d => [0, 128, 200], - pickable: true - }) - ], - goldenImage: './test/render/golden-images/arc-lnglat-64.png', - imageDiffOptions: !IS_HEADLESS && { - threshold: 0.985 - } - }, { name: 'line-lnglat', viewState: { @@ -555,31 +504,6 @@ export const TEST_CASES = [ ], goldenImage: './test/render/golden-images/line-lnglat.png' }, - { - name: 'line-lnglat-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11.5, - pitch: 0, - bearing: 0 - }, - layers: [ - new LineLayer({ - id: 'line-lnglat-64', - data: dataSamples.routes, - getWidth: 0, - widthMinPixels: 2, - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, - getSourcePosition: d => d.START, - getTargetPosition: d => d.END, - getColor: d => (d.SERVICE === 'WEEKDAY' ? [255, 64, 0] : [255, 200, 0]), - pickable: true - }) - ], - goldenImage: './test/render/golden-images/line-lnglat-64.png' - }, { name: 'icon-lnglat', viewState: { @@ -647,36 +571,6 @@ export const TEST_CASES = [ }, goldenImage: './test/render/golden-images/icon-lnglat-facing-up.png' }, - { - name: 'icon-lnglat-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11.5, - pitch: 0, - bearing: 0 - }, - // rendering times - renderingTimes: 2, - layers: [ - new IconLayer({ - id: 'icon-lnglat-64', - data: dataSamples.points, - iconAtlas: ICON_ATLAS, - iconMapping: dataSamples.iconAtlas, - sizeScale: 12, - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, - getPosition: d => d.COORDINATES, - getColor: d => [64, 64, 72], - getIcon: d => (d.PLACEMENT === 'SW' ? 'marker' : 'marker-warning'), - getSize: d => (d.RACKS > 2 ? 2 : 1), - opacity: 0.8, - pickable: true - }) - ], - goldenImage: './test/render/golden-images/icon-lnglat.png' - }, { name: 'icon-lnglat-auto', viewState: { @@ -694,7 +588,6 @@ export const TEST_CASES = [ data: dataSamples.points, sizeScale: 12, coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, getPosition: d => d.COORDINATES, getColor: d => [64, 64, 72], getIcon: d => { @@ -839,31 +732,6 @@ export const TEST_CASES = [ ], goldenImage: './test/render/golden-images/gridcell-lnglat.png' }, - { - name: 'gridcell-lnglat-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11.5, - pitch: 0, - bearing: 0 - }, - layers: [ - new GridCellLayer({ - id: 'gridcell-lnglat-64', - data: dataSamples.worldGrid.data, - cellSize: dataSamples.worldGrid.cellSize, - extruded: true, - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, - pickable: true, - opacity: 1, - getFillColor: g => [245, 166, g.value * 255, 255], - getElevation: h => h.value * 5000 - }) - ], - goldenImage: './test/render/golden-images/gridcell-lnglat.png' - }, { name: 'grid-lnglat', viewState: GRID_LAYER_INFO.viewState, @@ -1081,36 +949,6 @@ export const TEST_CASES = [ ], goldenImage: './test/render/golden-images/pointcloud-lnglat.png' }, - { - name: 'pointcloud-lnglat-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 13, - pitch: 0, - bearing: 0 - }, - layers: [ - new PointCloudLayer({ - id: 'pointcloud-lnglat-64', - data: dataSamples.getPointCloud(), - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - coordinateOrigin: dataSamples.positionOrigin, - fp64: true, - getPosition: d => [ - d.position[0] * 1e-5 - 122.42694203247012, - d.position[1] * 1e-5 + 37.751537058389985, - d.position[2] - ], - getNormal: d => d.normal, - getColor: d => d.color, - opacity: 1, - pointSize: 2, - pickable: true - }) - ], - goldenImage: './test/render/golden-images/pointcloud-lnglat-64.png' - }, { name: 'pointcloud-meter', viewState: { @@ -1194,35 +1032,6 @@ export const TEST_CASES = [ ], goldenImage: './test/render/golden-images/text-layer.png' }, - { - name: 'text-layer-64', - viewState: { - latitude: 37.751537058389985, - longitude: -122.42694203247012, - zoom: 11.5, - pitch: 0, - bearing: 0 - }, - layers: [ - new TextLayer({ - id: 'text-layer-64', - data: dataSamples.points.slice(0, 50), - fontFamily: 'Arial', - coordinateSystem: COORDINATE_SYSTEM.LNGLAT_DEPRECATED, - fp64: true, - getText: x => `${x.PLACEMENT}-${x.YR_INSTALLED}`, - getPosition: x => x.COORDINATES, - getColor: x => [153, 0, 0], - getSize: x => 16, - getAngle: x => 0, - sizeScale: 1, - getTextAnchor: x => 'start', - getAlignmentBaseline: x => 'center', - getPixelOffset: x => [10, 0] - }) - ], - goldenImage: './test/render/golden-images/text-layer.png' - }, { name: 'text-layer-meters', viewState: {