Multiple Viewports
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
Allow for multiple viewports/camera views in a single canvas.
* One `SceneManager` containing multiple `Scene`s
* `SceneManager` contains all non-view dependent primitives.
* Primitives updated once and rendered in each viewport
* Option on each primitive to hide for any number of viewports
* Each `Scene` contains a copy of view dependent primitives.
* Includes `Globe`
* All globes search terrain geometry and texture cache before requests
* All globes have the same terrain and imagery providers?
* Allow globes to have different terrain and imagery providers?
* Allow for different celestial bodies? (not implemented)
* Includes 3D Tilesets
* All tilesets search a geometry and texture cache before requests
* Allow different styling?
* Each tileset will have its own style and batch table
* Any other primitive where each vertex needs to be multiplied by a view dependent transform on the CPU.
* One `Scene` with a list of `Viewport`s that contain a camera and viewport rectangle.
* Non-view dependent primitives updated and rendered in each viewport.
* View dependent primitives can keep a command list per-viewport after updating for each camera
* Can not have different terrain or imagery provider
* Can not style 3D Tilesets per viewport.
The first option is more flexible but more complex. The second option is simpler but has a couple of constraints.
* Z-order the viewports. Model after `PrimitiveCollection`.
* `ScreenSpaceCameraController` needs to know which viewport the input originated in.
* Viewport positioning.
* Absolute values. App responsible for resizes
* Custom positioning implementation
* Position with CSS and hidden `div`s. Potentially expensive.
* Screen space passes for each viewport and for the final framebuffer.
* Allow the same primitive to have a different material in each viewport? (probably not)
Contributor guide
Research direction
No files, tests, or entry points are named. Start by comparing the two proposed Scene/Viewport architectures and resolving the listed constraints around z-ordering, input routing, positioning, caching, and screen-space passes. Done would require an agreed design and implementation scope for multiple viewports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100