Skip to content

Commit

Permalink
Bump to 9.1.0-alpha (#8833)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed Aug 30, 2024
1 parent 4ca79c1 commit ef46a9a
Show file tree
Hide file tree
Showing 66 changed files with 4,097 additions and 5,283 deletions.
10 changes: 7 additions & 3 deletions examples/layer-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
"start-local": "vite --config ../vite.config.local.mjs"
},
"dependencies": {
"@loaders.gl/ply": "^4.2.0",
"@loaders.gl/core": "^4.2.0",
"@loaders.gl/gltf": "^4.2.0",
"@loaders.gl/ply": "^4.2.0",
"@probe.gl/log": "^4.0.9",
"colorbrewer": "^1.0.0",
"d3-request": "^1.0.6",
"d3-scale": "^3.1.0",
"extrude-polyline": "^1.0.6",
"h3-js": "^4.1.0",
"maplibre-gl": "^3.0.0",
"react": "^16.3.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-autobind": "^1.0.6",
"react-dom": "^16.3.0",
"react-dom": "^18.2.0",
"react-map-gl": "^7.1.0",
"react-stats-zavatta": "^0.0.6"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@loaders.gl/csv": "^4.2.0",
"@loaders.gl/draco": "^4.2.0",
"@loaders.gl/gltf": "^4.2.0",
"@luma.gl/constants": "^9.0.4",
"@luma.gl/constants": "^9.1.0-alpha.19",
"brace": "^0.11.1",
"deck.gl": "^9.0.0",
"maplibre-gl": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/website/mesh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@loaders.gl/obj": "^4.2.0",
"@math.gl/core": "^4.0.0",
"@math.gl/core": "^4.1.0-alpha.3",
"deck.gl": "^9.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "9.0.0-beta.11",
"version": "9.1.0-alpha.0",
"npmClient": "yarn",
"packages": [
"modules/*"
Expand Down
18 changes: 9 additions & 9 deletions modules/aggregation-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "deck.gl layers that aggregate the input data into alternative representations",
"license": "MIT",
"type": "module",
"version": "9.0.0-beta.11",
"version": "9.1.0-alpha.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -38,17 +38,17 @@
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
},
"dependencies": {
"@luma.gl/constants": "^9.0.24",
"@luma.gl/shadertools": "^9.0.24",
"@math.gl/core": "^4.0.0",
"@math.gl/web-mercator": "^4.0.0",
"@luma.gl/constants": "^9.1.0-alpha.19",
"@luma.gl/shadertools": "^9.1.0-alpha.19",
"@math.gl/core": "^4.1.0-alpha.3",
"@math.gl/web-mercator": "^4.1.0-alpha.3",
"d3-hexbin": "^0.2.1"
},
"peerDependencies": {
"@deck.gl/core": "^9.0.0",
"@deck.gl/layers": "^9.0.0",
"@luma.gl/core": "^9.0.0",
"@luma.gl/engine": "^9.0.0"
"@deck.gl/core": "9.0.0-alpha.0",
"@deck.gl/layers": "9.0.0-alpha.0",
"@luma.gl/core": "^9.1.0-alpha.19",
"@luma.gl/engine": "^9.1.0-alpha.19"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import type {Device, Framebuffer} from '@luma.gl/core';

/**
* Marks GLSL shaders for syntax highlighting: glsl`...`
* Install https://marketplace.visualstudio.com/items?itemName=boyswan.glsl-literal
*/
export const glsl = (s: TemplateStringsArray) => `${s}`;

/**
* Create a float texture to store aggregation result
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BufferTransform} from '@luma.gl/engine';
import {glsl, createRenderTarget} from './utils';
import {createRenderTarget} from './utils';

import type {Device, Framebuffer, Buffer, Texture} from '@luma.gl/core';
import type {WebGLAggregatorProps} from './webgl-aggregator';
Expand Down Expand Up @@ -113,7 +113,7 @@ export class WebGLAggregationTransform {
}

function createTransform(device: Device, props: WebGLAggregatorProps): BufferTransform {
const vs = glsl`\
const vs = /* glsl */ `\
#version 300 es
#define SHADER_NAME gpu-aggregation-domain-vertex
Expand Down Expand Up @@ -174,7 +174,7 @@ void main() {
}
`;

const fs = glsl`\
const fs = /* glsl */ `\
#version 300 es
#define SHADER_NAME gpu-aggregation-domain-fragment
Expand Down Expand Up @@ -220,6 +220,7 @@ void main() {
fs,
topology: 'point-list',
parameters: {
blend: true,
blendColorSrcFactor: 'one',
blendColorDstFactor: 'one',
blendColorOperation: 'max',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Model, ModelProps} from '@luma.gl/engine';
import {glsl, createRenderTarget} from './utils';
import {createRenderTarget} from './utils';

import type {Device, Framebuffer, Texture} from '@luma.gl/core';
import type {WebGLAggregatorProps} from './webgl-aggregator';
Expand Down Expand Up @@ -149,6 +149,7 @@ export class WebGLBinSorter {
clearStencil: false
});
model.setParameters({
blend: true,
blendColorSrcFactor: 'one',
blendColorDstFactor: 'one',
blendAlphaSrcFactor: 'one',
Expand Down Expand Up @@ -180,7 +181,7 @@ function createModel(device: Device, props: WebGLAggregatorProps): Model {

if (props.dimensions === 2) {
// If user provides 2d bin IDs, convert them to 1d indices for data packing
userVs += glsl`
userVs += /* glsl */ `
void getBin(out int binId) {
ivec2 binId2;
getBin(binId2);
Expand Down Expand Up @@ -227,7 +228,7 @@ void main() {
#endif
}
`;
const fs = glsl`\
const fs = /* glsl */ `\
#version 300 es
#define SHADER_NAME gpu-aggregation-sort-bins-fragment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,10 @@ export default class HeatmapLayer<

if (colorTexture && colorTexture?.width === colorRange.length) {
// TODO(v9): Unclear whether `setSubImageData` is a public API, or what to use if not.
(colorTexture as any).setSubImageData({data: colors});
(colorTexture as any).setTexture2DData({data: colors});
} else {
colorTexture?.destroy();
// @ts-expect-error TODO(ib) - texture API change
colorTexture = this.context.device.createTexture({
...TEXTURE_PROPS,
data: colors,
Expand Down
10 changes: 5 additions & 5 deletions modules/arcgis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Use deck.gl as a custom ArcGIS API for JavaScript layer",
"license": "MIT",
"type": "module",
"version": "9.0.0-beta.11",
"version": "9.1.0-alpha.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -36,14 +36,14 @@
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
},
"dependencies": {
"@luma.gl/constants": "^9.0.24",
"@luma.gl/constants": "^9.1.0-alpha.19",
"esri-loader": "^3.7.0"
},
"peerDependencies": {
"@arcgis/core": "^4.0.0",
"@deck.gl/core": "^9.0.0",
"@luma.gl/core": "^9.0.0",
"@luma.gl/engine": "^9.0.0"
"@deck.gl/core": "9.0.0-alpha.0",
"@luma.gl/core": "^9.1.0-alpha.19",
"@luma.gl/engine": "^9.1.0-alpha.19"
},
"devDependencies": {
"@arcgis/core": "^4.21.0"
Expand Down
21 changes: 11 additions & 10 deletions modules/carto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "CARTO official integration with Deck.gl. Build geospatial applications using CARTO and Deck.gl.",
"license": "MIT",
"type": "module",
"version": "9.0.0-beta.11",
"version": "9.1.0-alpha.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -47,9 +47,9 @@
"@loaders.gl/mvt": "^4.2.0",
"@loaders.gl/schema": "^4.2.0",
"@loaders.gl/tiles": "^4.2.0",
"@luma.gl/core": "^9.0.24",
"@luma.gl/shadertools": "^9.0.24",
"@math.gl/web-mercator": "^4.0.0",
"@luma.gl/core": "^9.1.0-alpha.19",
"@luma.gl/shadertools": "^9.1.0-alpha.19",
"@math.gl/web-mercator": "^4.1.0-alpha.3",
"@types/d3-array": "^3.0.2",
"@types/d3-color": "^1.4.2",
"@types/d3-scale": "^3.0.0",
Expand All @@ -65,12 +65,13 @@
"quadbin": "^0.2.0"
},
"peerDependencies": {
"@deck.gl/aggregation-layers": "^9.0.0",
"@deck.gl/core": "^9.0.0",
"@deck.gl/extensions": "^9.0.0",
"@deck.gl/geo-layers": "^9.0.0",
"@deck.gl/layers": "^9.0.0",
"@loaders.gl/core": "^4.2.0"
"@deck.gl/aggregation-layers": "9.0.0-alpha.0",
"@deck.gl/core": "9.0.0-alpha.0",
"@deck.gl/extensions": "9.0.0-alpha.0",
"@deck.gl/geo-layers": "9.0.0-alpha.0",
"@deck.gl/layers": "9.0.0-alpha.0",
"@loaders.gl/core": "^4.2.0",
"@luma.gl/core": "^9.1.0-alpha.19"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
1 change: 1 addition & 0 deletions modules/carto/src/layers/heatmap-tile-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class HeatmapTileLayer<DataT = any, ExtraProps extends {} = {}> extends Composit
(colorTexture as any).setSubImageData({data: colors});
} else {
colorTexture?.destroy();
// @ts-ignore TODO v9.1
colorTexture = this.context.device.createTexture({
...TEXTURE_PROPS,
data: colors,
Expand Down
6 changes: 4 additions & 2 deletions modules/carto/src/layers/heatmap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {ShaderPass} from '@luma.gl/shadertools';
import {Texture} from '@luma.gl/core';
const glsl = (s: TemplateStringsArray) => `${s}`;

/**
* @filter Heatmap
Expand All @@ -11,7 +10,7 @@ const glsl = (s: TemplateStringsArray) => `${s}`;
* @param opacity Output opacity
*/

const fs = glsl`\
const fs = /* glsl */ `\
uniform heatmapUniforms {
vec2 colorDomain;
vec2 delta;
Expand Down Expand Up @@ -134,6 +133,7 @@ export const heatmap = {
opacity: 'f32',
radiusPixels: 'f32'
},
// @ts-ignore TODO v9.1
getUniforms: opts => {
if (!opts) return {};
const {
Expand All @@ -155,7 +155,9 @@ export const heatmap = {
},
fs,
passes: [
// @ts-expect-error Seems typing in luma.gl should be Partial<>
{sampler: true, uniforms: {delta: [1, 0]}},
// @ts-expect-error Seems typing in luma.gl should be Partial<>
{sampler: true, uniforms: {delta: [0, 1]}}
]
} as const satisfies ShaderPass<HeatmapProps & PassProps>;
4 changes: 2 additions & 2 deletions modules/carto/src/layers/point-label-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class EnhancedTextBackgroundLayer extends TextBackgroundLayer {

// Modify shader so that the padding is offset by the pixel offset to ensure the padding
// always captures the anchor point. As padding is uniform we cannot pass it a per-label value
vs = vs.replaceAll('padding.', '_padding.');
vs = vs.replaceAll('textBackground.padding.', '_padding.');
vs = vs.replace(
'void main(void) {',
'void main(void) {\n vec4 _padding = padding + instancePixelOffsets.xyxy * vec4(1.0, 1.0, -1.0, -1.0);'
'void main(void) {\n vec4 _padding = textBackground.padding + instancePixelOffsets.xyxy * vec4(1.0, 1.0, -1.0, -1.0);'
);

return {...shaders, vs};
Expand Down
19 changes: 10 additions & 9 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "deck.gl core library",
"license": "MIT",
"type": "module",
"version": "9.0.0-beta.11",
"version": "9.1.0-alpha.0",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -42,14 +42,15 @@
"dependencies": {
"@loaders.gl/core": "^4.2.0",
"@loaders.gl/images": "^4.2.0",
"@luma.gl/constants": "^9.0.24",
"@luma.gl/core": "^9.0.24",
"@luma.gl/engine": "^9.0.24",
"@luma.gl/shadertools": "^9.0.24",
"@luma.gl/webgl": "^9.0.24",
"@math.gl/core": "^4.0.0",
"@math.gl/sun": "^4.0.0",
"@math.gl/web-mercator": "^4.0.0",
"@luma.gl/constants": "^9.1.0-alpha.19",
"@luma.gl/core": "^9.1.0-alpha.19",
"@luma.gl/engine": "^9.1.0-alpha.19",
"@luma.gl/shadertools": "^9.1.0-alpha.19",
"@luma.gl/webgl": "^9.1.0-alpha.19",
"@math.gl/core": "^4.1.0-alpha.3",
"@math.gl/sun": "^4.1.0-alpha.3",
"@math.gl/types": "^4.1.0-alpha.3",
"@math.gl/web-mercator": "^4.1.0-alpha.3",
"@probe.gl/env": "^4.0.9",
"@probe.gl/log": "^4.0.9",
"@probe.gl/stats": "^4.0.9",
Expand Down
4 changes: 2 additions & 2 deletions modules/core/src/effects/lighting/camera-light.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable camelcase */
import type {NumberArray16} from '@math.gl/types';
import {PointLight} from './point-light';
import {getUniformsFromViewport} from '../../shaderlib/project/viewport-uniforms';
import type Layer from '../../lib/layer';
import {NumArray16} from '../../shaderlib/misc/uniform-types';

export default class CameraLight extends PointLight {
getProjectedLight({layer}: {layer: Layer}): PointLight {
Expand All @@ -11,7 +11,7 @@ export default class CameraLight extends PointLight {
const {coordinateSystem, coordinateOrigin, modelMatrix} = layer.props;
const {cameraPosition} = getUniformsFromViewport({
viewport,
modelMatrix: modelMatrix as NumArray16,
modelMatrix: modelMatrix as NumberArray16,
coordinateSystem,
coordinateOrigin
});
Expand Down
6 changes: 2 additions & 4 deletions modules/core/src/effects/lighting/lighting-effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default class LightingEffect implements Effect {
private directionalLights: DirectionalLight[] = [];
private pointLights: PointLight[] = [];
private shadowPasses: ShadowPass[] = [];
private shadowMaps: Texture[] = [];
private dummyShadowMap: Texture | null = null;
private shadowMatrices?: Matrix4[];

Expand Down Expand Up @@ -132,7 +131,7 @@ export default class LightingEffect implements Effect {
shadowMatrices?: Matrix4[];
} = this.shadow
? {
shadowMaps: this.shadowMaps,
shadowMaps: this.shadowPasses.map(shadowPass => shadowPass.getShadowMap()),
dummyShadowMap: this.dummyShadowMap,
shadowColor: this.shadowColor,
shadowMatrices: this.shadowMatrices
Expand All @@ -142,6 +141,7 @@ export default class LightingEffect implements Effect {
// when not rendering to screen, turn off lighting by adding empty light source object
// lights shader module relies on the `lightSources` to turn on/off lighting
parameters.lightSources = {
enabled: true,
ambientLight: this.ambientLight,
directionalLights: this.directionalLights.map(directionalLight =>
directionalLight.getProjectedLight({layer})
Expand All @@ -157,7 +157,6 @@ export default class LightingEffect implements Effect {
shadowPass.delete();
}
this.shadowPasses.length = 0;
this.shadowMaps.length = 0;

if (this.dummyShadowMap) {
this.dummyShadowMap.destroy();
Expand All @@ -182,7 +181,6 @@ export default class LightingEffect implements Effect {
for (let i = 0; i < this.directionalLights.length; i++) {
const shadowPass = new ShadowPass(device);
this.shadowPasses[i] = shadowPass;
this.shadowMaps[i] = shadowPass.shadowMap;
}
}

Expand Down
Loading

0 comments on commit ef46a9a

Please sign in to comment.