Skip to content

[Tracking] Graphics Modernization (GM) #7640

Description

@birkskyum

After sunsetting WebGL1 as part of GL JS v6 ( #3947 ) we are positioned to move the graphics pipeline forward towards a modern WebGL2 and WebGPU dual renderer. This is a tracking ticket for that modernization.

Phase 1 - Complete - WebGL2 Pre-Architectural Improvements - WebGL2 improvements that don't depend on the Drawable architecture from Phase 3. Texture allocation, shader attribute declaration, vertex attribute binding, and modern GLSL ES 3.00 features.

Phase 2 - Shared rendering state - Move projection, terrain and per-frame shader values into shared std140 UBOs. Bring shared rendering inputs together in the render context, so they're clearer to use, don't need to be set up separately for each draw, and drawing code doesn't need the painter.

Checkpoint - Fix the horizon sky/atmosphere

Checkpoint - Refactor camera state ownership

Phase 3 - Drawable Rendering Architecture - Each draw call becomes a persistent Drawable that keeps its geometry, shader, textures and settings between frames, following maplibre-native's drawable / tweaker design. Shader values move into uniform buffers that are only uploaded when they change. Layers move one at a time, and each PR replaces the old draw code instead of keeping both.

Checkpoint - Fix the horizon fog

  • GM-3.4 Move fill and its outline to drawables
  • GM-3.5 Move fill shader values into uniform buffers, including data-driven properties
  • GM-3.6 Move line and its variants to drawables
  • GM-3.7 Move line shader values into uniform buffers
  • GM-3.8 Move circle to drawables and uniform buffers
  • GM-3.9 Move fill extrusion to drawables and uniform buffers
  • GM-3.10 Move raster to drawables and uniform buffers
  • GM-3.11 Move hillshade and color relief to drawables and uniform buffers
  • GM-3.12 Move heatmap to drawables and uniform buffers
  • GM-3.13 Move symbol to drawables
  • GM-3.14 Move symbol shader values into uniform buffers
  • GM-3.15 Remove the old uniform setters

Phase 4 - Instanced Rendering - Draws repetitive features in bulk with WebGL2 instancing. Circles first, symbols if measurements justify it.

  • GM-4.1 Add instancing to the Drawable contract
  • GM-4.2 Instance circles
  • GM-4.3 Instance symbols

Phase 5 - WebGPU Backend - A second executor (WebGPUDrawable) over the same drawables and block layouts, shipped as a lazily loaded chunk so the main bundle keeps one renderer.

  • GM-5.1 Add the async renderer lifecycle seam and WebGPU device initialization, based on ibgreen's staged work
  • GM-5.2 Add the WebGPU render pass and stencil clipping
  • GM-5.3 Add backend-owned buffers
  • GM-5.4 Render background end to end on WebGPU
  • GM-5.x Move the remaining layers to WebGPU

Phase 6 - Evaluate luma.gl for shared WebGPU/WebGL2 code - There are PoC's that show a luma.gl backend is feasible on the current code. luma.gl v10 develops in parallel with Phases 3 to 5; once both GL JS backends exist, the question is whether luma.gl can replace the shared implementation layer, be offered as an optional backend next to it, or not be adopted.

  • GM-6.1 Rebase the luma.gl evaluation onto the finished drawable architecture and luma.gl v10, and measure code, bundle chunk size, performance and feature coverage
  • GM-6.2 Decide between adopting luma.gl, offering it as an optional backend, or staying direct
  • GM-6.x Implement the decision

Misc.

  • Compute tile projection and terrain data once per frame
  • Refer to the projection shader variant by name

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmetaThis is an meta/tracking issue spanning multiple concerns and not a concrete issueperformanceRelated to performance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions