mapbox / mapbox/mapbox-gl-js

Use ANGLE_instanced_arrays extension to reduce buffer sizes for layers with property functions

Open
#1,898 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance :zap:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/

According to [this presentation about WebGL2](https://docs.google.com/presentation/d/1Orx0GB0cQcYhHkYsaEcoo5js3c5-pv7ahPniIRIzzfg), this feature (available for WebGL 1.0 as extension) can lead to significant performance gains. Interesting bit:

> Google Maps uses and requires instancing support — Reduces vertex buffer size by 6x (!)

The concept is:

> To draw 1000 soldiers
> 1000 draw calls, with different position, posture, etc
> Or, with instancing, only 1 draw call
> Big perf improvement

cc @ansis @kkaefer @jfirebaugh @lucaswoj what do you think? Can we use it?

Also related: https://github.com/mapbox/mapbox-gl-js/issues/1361 (mentioned in the slides as a notable perf feature too)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the ANGLE_instanced_arrays specification and the related mapbox-gl-js issue 1361. Then locate the WebGL rendering paths for layers with property functions and determine whether instancing is supported by the project’s target contexts. Done would require an agreed implementation scope, measurable buffer or draw-call improvements, and coverage for supported and unsupported contexts.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.