Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.1 whats-new & upgrade guide #9298

Merged
merged 13 commits into from
Jan 8, 2025
24 changes: 24 additions & 0 deletions docs/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ Breaking changes:

- `PointLight.attenuation` was previously ignored. To retain old behavior, use the default (`[1, 0, 0]`).

### Uniform buffers

GLSL shaders that take inputs via WebGL1-style uniforms need to be migrated to use uniform buffers instead. For example:

```glsl
// Global uniform
uniform float opacity;

// UBO
uniform layerUniforms {
uniform float opacity;
} layer;
```

The [ShaderModule](https://luma.gl/docs/api-reference/shadertools/shader-module) class is used to encapsulate and inject the uniforms, as well as providing using useful type checks. It maps (typed) props to bindings and uniforms defined in the UBO block, which [ShaderInputs](https://luma.gl/docs/api-reference/engine/shader-inputs) uses to update bindings and uniform buffers on the GPU.

See [layerUniforms](https://github.com/visgl/deck.gl/blob/master/modules/core/src/shaderlib/misc/layer-uniforms.ts) for an example.

Layers need to be modified:
- `getShaders()` needs to additionaly return the `ShaderModule` that defines the UBO
- Instead of calling `model.setUniforms` (or `model.setBindings`) use `model.shaderInputs.setProps` to update the UBO with props

For more information see [presentation](https://docs.google.com/presentation/d/1OcjA_hdu6vEvL_nxm7ywnXZQbMr5eR4R_L-wcz6K0HI/) ([recording](https://www.youtube.com/watch?v=ei6scnRpNhU))

## Upgrading to v9.0

**Before you upgrade: known issues**
Expand Down
41 changes: 37 additions & 4 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,39 @@ This page contains highlights of each deck.gl release. Also check our [vis.gl bl

## deck.gl v9.1

Release date: TBD (targeting September 2024)
Release date: TBD (targeting December 2024)

<table style={{border: 0}} align="center">
<tbody>
<tr>
<td>
<img style={{maxHeight:200}} src="https://github.com/user-attachments/assets/e522d961-600a-4405-9f09-c247b42f7e62" />
<p><i>Maplibre Globe View</i></p>
</td>
<td>
<img style={{maxHeight:200}} src="https://github.com/visgl/deck.gl/assets/453755/f1a10ffd-d403-4ea5-958d-3bc8fea412fe" />
<p><i>React Widgets</i></p>
</td>
<td>
<img style={{maxHeight:200}} src="https://github.com/user-attachments/assets/a3cc7c70-10a5-40c1-a5a8-d5d8b2d165ba" />
<p><i>Aggregation Layers</i></p>
</td>
<td>
<img style={{maxHeight:200}} src="https://www.w3.org/2023/02/webgpu-logos/webgpu-notext.svg" />
<p><i>WebGPU readiness</i></p>
</td>
</tr>
</tbody>
</table>

### WebGPU readiness

- luma.gl v9.1
- All layers migrated to UBO
### Maplibre Globe View

MapLibre v5 recently launched a [globe view](https://github.com/maplibre/maplibre-gl-js/issues/307), and in collaboration with the MapLibre team, we have add support for seamlessly integrating deck.gl layers with the globe using the existing [GlobeView](./api-reference/core/globe-view). The integration works for all three [Intergration Modes](./developer-guide/base-maps/using-with-maplibre#integration-modes).
felixpalmer marked this conversation as resolved.
Show resolved Hide resolved

### React Widgets

deck.gl v9.0 added support for widgets, with v9.1 they can now be defined in React. A major benefit is the ablility to define custom widgets with UI built in React.
felixpalmer marked this conversation as resolved.
Show resolved Hide resolved

### Aggregation layers upgrade

Expand All @@ -26,6 +53,12 @@ Highlights:

See [upgrade guide](./upgrade-guide.md) for more details.

### WebGPU readiness

- luma.gl has been updated to v9.1 which focuses on building out WebGPU support. For details see [release notes](https://luma.gl/docs/whats-new#version-91-in-development) and [upgrade-guide](https://luma.gl/docs/upgrade-guide#upgrading-to-v91).
felixpalmer marked this conversation as resolved.
Show resolved Hide resolved
- As part of WebGPU readiness, all shader code in deck.gl v9.1 (layers and extensions) have been migrated to use uniform buffers instead of WebGL1 style uniforms.
- For most users this change should be transparent, but custom layers that add `uniforms` should [start migrating asap](./upgrade-guide.md) as WebGL1 style uniform support is being actively phased out.

## deck.gl v9.0

Release date: March 21, 2024
Expand Down
Loading