Skip to content

Commit ce3fbcf

Browse files
authored
Update Viewport RFCs (visgl#1301)
1 parent 29fb3e1 commit ce3fbcf

11 files changed

Lines changed: 513 additions & 298 deletions

dev-docs/RFCs/README.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Implementation of non-trivial new deck.gl features should typically be started o
99
| **Pre-Approved** | No major initial objections, draft pre-approved for prototyping |
1010
| **Review** | Ready for formal review |
1111
| **Approved** | Approved, ready for implementation |
12-
| **Implemented** | Approved and implemented |
12+
| **Experimental** | Approved, implemented as experimental API |
13+
| **Implemented** | Approved and implemented (as officially supported API) |
1314
| **Deferred** | Review uncovered reasons not to proceed at this time |
1415
| **Rejected** | Review uncovered reasons not to proceed |
1516

@@ -31,27 +32,36 @@ These are early ideas not yet associated with any release
3132
| [**Projection Mode Improvements**](vNext/projection-mode-improvements-rfc.md) | @ibgreen @pessimistress | **Draft** | Improvements to projection system |
3233
| [**Composite Layer Customization**](vNext/composite-layer-customization-rfc.md) | @ibgreen | **Draft** | Improvements to customizing composite layers |
3334
| [**Shader Module Injection**](vNext/shader-module-injection-rfc.md) | @ibgreen | **Draft** | |
35+
| | | | |
36+
| **Effects** | | | |
37+
| **[Effects Manager](v6.0/effects-manager-rfc.md)** | @1chandu @ibgreen | Draft | Official support for effects (shadows, reflections, better lighting, postprocessing, framebuffer composition etc). |
38+
| **[Render Layer to Texture](v6.0/render-layer-to-texture-rfc.md)** | TBD | Proposed | Allow layers to render to texture and then use texture in subsequent layers. |
3439

3540

3641
## v6.0 RFCs
3742

38-
Current direction for [deck.gl v6.0](https://github.com/uber/deck.gl/projects/3) is to focus on **animation** and **visual effects**, so we want to prioritize related RFCs. In particular, the topic of animation is big, and it has been broken down into a number of separete RFCs that should all move us in the right direction.
43+
Current direction for [deck.gl v6.0](https://github.com/uber/deck.gl/projects/3) is to focus on **animation** and TBA...
44+
45+
So we want to prioritize related RFCs. In particular, the topic of animation is big, and it has been broken down into a number of separete RFCs that should all move us in the right direction.
46+
47+
Also see luma.gl RFCs
3948

4049
| RFC | Author | Status | Description |
4150
| --- | --- | --- | --- |
4251
| **Animation** | | | |
52+
| [**PropTypes**](v6.0/prop-types-rfc.md) | ? | Draft | Validate e.g ranges for numeric attributes, support animation/auto-interpolation. |
4353
| [**Property Animation**](v6.0/property-animation-rfc.md) | @ibgreen | Draft | Allow Layer props and GL parameters to accept functions in addition to values and call these on every render to update values |
4454
| [**Attribute Animation**](v6.0/attribute-animation-rfc.md) | @pessimistress | Proposed | Automatically interpolate between two copies of a vertex attributes |
45-
| [**PropTypes**](v6.0/prop-types-rfc.md) | ? | Draft | Validate e.g ranges for numeric attributes, support animation/auto-interpolation. |
4655
| [**Expose Layer AttributeManager**](v6.0/expose-attribute-manager.md) | @ibgreen | **Review** | simplifies pregenerating attributes in apps for fast animation. |
4756
| | | | |
48-
| **Effects** | | | |
49-
| **[Effects Manager](v6.0/effects-manager-rfc.md)** | @1chandu @ibgreen | Draft | Official support for effects (shadows, reflections, better lighting, postprocessing, framebuffer composition etc). |
50-
| **[Render Layer to Texture](v6.0/render-layer-to-texture-rfc.md)** | TBD | Proposed | Allow layers to render to texture and then use texture in subsequent layers. |
51-
| | | | |
5257
| **Ease-of-Use** | | | |
5358
| [**dataUrl**](v6.0/data-url-rfc.md) | @pessimistress & @ibgreen | Draft | **Ease-of-Use** Allow deck.gl layers to specify a URL and asynchronously download the resulting data |
5459
| | | | |
60+
| **Finalize Multi-Viewport API** | | | |
61+
| [**New View Class**](v6.0/view-class-rfc.md) | @ibgreen | **Draft** | Proposed Official API for multi-view(port) support, replacing the v5.0 experimental API |
62+
| [**Per-View Controllers**](v6.0/per-view-controllers-rfc.md) | @ibgreen | **Draft** | Support one controller per view in multi-view apps |
63+
| [**Unified ViewState**](v6.0/view-state-rfc.md) | @ibgreen | **Draft** | Highly controversial proposal for an even more Unified View/Controller Architecture. Will likely be deferred. Review again after other related RFCs have been approved/implemented |
64+
| | | | |
5565
| **Internals** | | | |
5666
| [**Reduce Distribution Size**](v6.0/reduce-distribution-size-rfc.md) | @ibgreen | **Review** | **Hygiene** Reduce size of distribution and the bundle size of apps consuming deck.gl |
5767
| [**Reduce Repository Size**](v6.0/reduce-repo-size-rfc.md) | @ibgreen | **Draft** | **Hygiene** Reduce size of deck.gl github repository |
@@ -62,39 +72,37 @@ Possible other animation related RFCs:
6272

6373
## v5.0 RFCs
6474

65-
These RFCs are being implemented (fully or partially) in v5.0.
75+
These RFCs were implemented in v5.0. Also see luma.gl RFCs.
6676

6777
| RFC | Author | Status | Description |
6878
| --- | --- | --- | --- |
6979
| **Animation** | | | |
7080
| [**Auto Highlighting**](v5.0/auto-highlighting-rfc.md) | @ibgreen @1chandu | **Implemented** | Auto highlight hovered object via `picking` module |
71-
| [**Viewport interpolation**](v5.0/viewport-animation-rfc.md) | @1chandu | Proposed | This should build on the new Viewport system in the First Person RFC. Also needs to consider react-map-gl. |
81+
| [**Viewport interpolation**](v5.0/viewport-animation-rfc.md) | @1chandu | **Experimental** | This should build on the new Viewport system in the First Person RFC. Also needs to consider react-map-gl. |
7282
| | | | |
7383
| **Viewports and Controllers** | | | |
74-
| [**First Person Viewport**](v5.0/first-person-mercator-viewport-rfc.md) | @ibgreen | **Pre-Approved** | Geospatially enable all viewports |
75-
| [**Multiple Viewports**](v5.0/multi-viewport-rfc.md) | @ibgreen | **Pre-Approved** | Supoort for multiple viewports, synchronized or unsynchronized |
76-
| [**Controller Architecture**](v5.0/controller-architecture-rfc.md) | @ibgreen | **Draft** | Generalize and Freeze experimental Controller Architecture from v4.1 |
84+
| [**First Person Geospatial Viewport**](v5.0/first-person-mercator-viewport-rfc.md) | @ibgreen | **Experimental** | Geospatially enable all viewports, add FirstPersonViewport for hybrid apps. |
85+
| [**Multiple Viewports**](v5.0/multi-viewport-rfc.md) | @ibgreen | **Experimental** | Support for multiple viewports |
7786
| | | | |
7887
| **General** | | | |
79-
| [**Break out EventManager**](v5.0/break-out-event-manager-rfc.md) | @ibgreen | **Draft** | **Hygiene** Break out shared event manager code |
80-
| [**Break out Math Module**](v5.0/break-out-math-module-rfc.md) | @ibgreen | **Draft** | **Hygiene** Break out luma.gl math module |
88+
| [**Break out EventManager**](v5.0/break-out-event-manager-rfc.md) | @ibgreen | **Implemented** | **Hygiene** Break out event manager module |
8189

8290

8391
## v4.1 RFCs
8492

85-
These RFCs that have been implemented (fully or partially) in v4.1.
93+
These RFCs were implemented in v4.1.
8694

8795
| RFC | Author | Status | Description |
8896
| --- | --- | --- | --- |
8997
| [**Picking Improvements**](v4.1/picking-improvements-rfc.md) | @shaojingli | "Direction" RFC | Outlines a number of improvements to picking |
90-
| [**Event Handling**](v4.1/event-handling-rfc.md) | Many authors | **Approved** & Implemented | Attempt to define enduring event handling architecture |
98+
| [**Event Handling**](v4.1/event-handling-rfc.md) | Many authors | **Implemented** | Attempt to define enduring event handling architecture |
9199

92100

93101
## v4.0 RFCs
94102

95-
These RFCs that have been implemented (fully or partially) in v4.0.
103+
These RFCs were implemented in v4.0.
96104

97105
| RFC | Author | Status | Description |
98106
| --- | --- | --- | --- |
99-
| [**Non-Geospatial Viewports**](v4.0/non-geospatial-viewports-rfc.md) | @ibgreen @gnavvy | **Approved** & Implemented | Support for non-geospatial viewports |
100-
| [**Composite Layer Prop Forwarding**](v4.0/composite-layer-prop-forwarding-rfc.md) | @shaojingli | **Approved** & Implemented | Conventions for prop forwarding |
107+
| [**Non-Geospatial Viewports**](v4.0/non-geospatial-viewports-rfc.md) | @ibgreen @gnavvy | **Implemented** | Support for non-geospatial viewports |
108+
| [**Composite Layer Prop Forwarding**](v4.0/composite-layer-prop-forwarding-rfc.md) | @shaojingli | **Implemented** | Conventions for prop forwarding |

dev-docs/RFCs/v5.0/auto-highlighting-rfc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* **Authors**: Ravi Akkenapally and Ib Green
44
* **Date**: August 9, 2017
5-
* **Status**: **Approved and Implementd**
5+
* **Status**: **Implemented**
66

77
Notes:
88
* Please add comments as reviews to the [PR](https://github.com/uber/deck.gl/pull/839)

dev-docs/RFCs/v5.0/break-out-event-manager-rfc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# RFC: Break out Event Manager
22

3-
* **Author**: Ib Green & ?
3+
* **Author**: Ib Green & Xiaoji Chen
44
* **Date**: Aug, 2017
5-
* **Status**: Draft
5+
* **Status**: **Imlemented**
66

77

88
## Motivation

dev-docs/RFCs/v5.0/break-out-math-module-rfc.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

dev-docs/RFCs/v5.0/first-person-mercator-viewport-rfc.md renamed to dev-docs/RFCs/v5.0/first-person-geospatial-viewport-rfc.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
# RFC - First Person Viewport
1+
# RFC - First Person Geospatial Viewport
22

33
* **Author**: Ib Green
44
* **Date**: August 10, 2017
5-
* **Status**: **Pre-Approved**
6-
7-
Notes:
8-
* Please add comments as reviews to the [PR](https://github.com/uber/deck.gl/pull/838)
5+
* **Status**: **Implemented**
96

107
References:
11-
* Controller Changes [Controller Architecture RFC](./controller-architecture-rfc.md)
128
* The initial [Infovis Viewport RFC](../v4.0/non-geospatial-viewports-rfc.md) for deck.gl v4.
9+
* Controller Changes [Controller Architecture RFC](./controller-architecture-rfc.md)
10+
* Initial review in [PR](https://github.com/uber/deck.gl/pull/838)
11+
12+
13+
## Overview
14+
15+
This RFC proposes:
16+
* An "extended" Viewport hierarchy that adds subclasses based on "differences in view matrix" in addition to differences in projection matrix.
17+
* The new hierarchy includes a "FirstPersonViewport" class that allows the application to specify eye position directly.
18+
* All Viewports are "geospatially enabled", i.e. they can take a lng/lat anchor in addition to their normal coordinates.
19+
* Viewports support the same options as layers, including model matrices so that apps can use their data coordinates to place FirstPersonViewports.
1320

1421

1522
## Motivation
@@ -36,19 +43,20 @@ However, to synchronize our 3D data with external perspective-enabled map system
3643
The map system typically locks in FoV (Field of view), viewing angle (always pitched downward) and altitude (camera height over the “ground”).
3744
When rendering 3D environments on top of pre-rendered video (e.g. overlaying perception data on top of vehicle log cameras)
3845

39-
Note: There are subtleties around the positioning of the camera which is handled in the next proposal.
46+
## Proposed Features
4047

41-
42-
## Proposal Part 1: Geospatially Enable all Viewports
48+
### Proposed: Geospatially Enable all Viewports
4349

4450
In deck.gl 4.1 only the WebMercatorViewport can handle layers with geospatial coordinates: it is the only viewport that can produce the uniforms required by the project module. But moving some properties from the `WebMercatorViewport` class into the base viewport, it is possible to extend cartographic projection to all viewpott.
4551

4652
The key insight is that through the addition of the "meters mode", we have already addedthe general capability of overlaying an arbitrary linear coordinate system (which is what all non-geospatial viewports use) on top of a geospatial coordinate system using an anchor point.
4753

4854
While METER_OFFSETS mode was initially introduced to solve a narrow use-case, the technique is actually very general, and there is no reason why we would not support geospatial anchoring and linear coordinates for all viewports (in addition to layers), including first person and orbit (i.e. third person) viewports.
4955

56+
Note: There are subtleties around the positioning of the camera which is handled in the next proposal.
57+
5058

51-
## Proposal Part 2: An Alternative Viewport Hierarchy
59+
### Proposed: An Alternative Viewport Hierarchy
5260

5361
In deck.gl v4.0, a viewport class hierarchy was introduced to support non-geospatial viewports. It separates between `Perspective` and `Orthographic` cameras (inspired by common WebGL frameworks).
5462

@@ -59,12 +67,11 @@ As an alternative to the `Perspective`/`Orthographic` camera class, this RFC rec
5967
Also, since the majority viewports will be used with a perspective projection matrix, if the `projectionMatrix` prop is not supplied, `Viewport` will try to create a perspective projection matrix using new `fov`, `near` and `far` props (note that `aspect` is automatically calculated from `width` and `height`).
6068

6169

62-
## Summary of Proposed Changes
70+
## Proposed API Changes
6371

64-
### Viewport
72+
### New `Viewport` Properties and Methods
6573

6674
New properties:
67-
6875
- `longitude` - (optional) anchor
6976
- `latitude` - (optional) anchor
7077
- `zoom` scale - This will be hardcoded to meter = unity scale by `FirstPersonViewport`
@@ -76,27 +83,25 @@ New properties:
7683
- `far`
7784

7885
New Methods:
79-
8086
* `Viewport.isGeospatial()` can be called to check if a viewport is geospatially "enabled". If longitude, latitude and zoom are supplied to a viewport, then that viewport is considered geospatial.
8187
* `Viewport.isMapSynched()` offers an easy way for the app to determine if a base map can be displayed under the viewport.
8288
* `Viewport.getMercatorParameters()` offers a way to get map props that include offsets etc.
8389

84-
8590
Remarks:
8691
* `modelMatrix` - A convenience to make the viewport API more similar to the `Layer` props. When positioning the camera in a scene with `Layer`s using a certain `modelMatrix` it is nice to be able to use the same coordinates and the same `modelMatrix` with the viewport.
8792
* `projectionMatrix` - When supplied, the projectionMatrix parameter allows for complete application control of all **projection** matrix parameters - including field-of-view, near/far clipping planes, aspect ratios etc, e.g. using `new Matrix4().projection(...)` or `new Matrix4().ortho(...)` etc..
8893

8994

90-
### FirstPersonViewport
95+
### Proposed: New `FirstPersonViewport` Class
9196

9297
Extends `Viewport`. Creates a `Viewport` with a view matrix that is placed in the player's position, with a controllable direction and orientation:
9398
- `direction` (`Vector3`) - player direction
9499
- `up` (`Vector3`, `[0, 0, 1]`): specifies the camera up direction
95100

96101

97-
### ThirdPersonViewport
102+
### Proposed: New `ThirdPersonViewport` Class
98103

99-
This prototyping behind this proposal has so far not focused on `ThirdPersonViewport`. It is expected to extend `Viewport`, possibly with props such as:
104+
`ThirdPersonViewport` is expected to extend `Viewport`, possibly with props such as:
100105
- player `direction`
101106
- camera `direction`, relative to player direction (additive to player `direction`)
102107
- camera `distance,` from player
@@ -106,7 +111,7 @@ The idea here with two directions being that one might want a third person camer
106111
See comments under `OrbitViewport` below.
107112

108113

109-
### WebMercatorViewport
114+
### Proposed: `WebMercatorViewport` Changes
110115

111116
Creates a viewport with a special perspective projection matrix with a FOV that works with mapbox-gl, and a view matrix that follows mapbox-gl's undocumented internal bearing/pitch/altitude conventions.
112117

@@ -122,9 +127,9 @@ inherits from `Viewport`, setting parameters as follows
122127

123128
`isMapSynched()` would return false for a `Viewport` (Note: not a `Layer`):
124129
* If `position` is specified
125-
* If `modelMatrix is specified
126-
* If `altitude is !== 0.5
127-
* If `pitch > 60 degrees
130+
* If `modelMatrix` is specified
131+
* If `altitude` is !== 0.5
132+
* If `pitch` > 60 degrees
128133

129134
We could also check zoom levels etc, potentially moving all mapbox limit checks into the `WebMercatorViewport` viewport.
130135

0 commit comments

Comments
 (0)