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
50 changes: 46 additions & 4 deletions docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,48 @@ 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)

### WebGPU readiness
<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>


### Maplibre Globe View

- The deck.gl [`GlobeView`](./api-reference/core/globe-view) now integrates seamlessly with the MapLibre v5 [globe view](https://maplibre.org/roadmap/globe-view/).
- The Maplibre globe view integration was done in close collaboration with the MapLibre team, and works for all three [Basemap Intergration Modes](./developer-guide/base-maps/using-with-maplibre#integration-modes).
- The deck.gl `GlobeView` is no longer considered experimental, and can now be imported without a leading underscore.

- luma.gl v9.1
- All layers migrated to UBO
### React Widgets

deck.gl v9.0 added support for widgets, with v9.1 users can now create React components with the same level of deep deck.gl integration.
- All the official deck.gl widgets can now be easily wrapped into React components with the new `useWidget` hook.
- Pre-wrapped React components for existing widget are available from the `@deck.gl/react` package.
- To try it out, check out our new [getting started example](https://github.com/visgl/deck.gl/tree/master/examples/get-started/react/widgets) for using widgets in React.

### Widgets Developer Guide

deck.gl v9.1 provides the ability to for applications to write React component that integrate with deck.gl using the widget interface. Learn how to write such React components with our new [Custom Widgets Developer Guide](./docs/developer-guide/custom-widgets).

### Aggregation layers upgrade

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

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

### WebGPU readiness

- luma.gl has been updated to v9.1 which focuses on improved 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).
- 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