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

v3.0.0-beta.1 (advanced 3D lighting, shadows, nested styles and more) #12829

Merged
merged 201 commits into from
Aug 7, 2023
Merged

Conversation

mourner
Copy link
Member

@mourner mourner commented Aug 7, 2023

This is the first public beta version of GL JS v3, which adds support for the Mapbox Standard Style, a new realistic 3D lighting system, building shadows and many other visual enhancements, and nested, configurable styles. 🌇

Stay tuned for a detailed blog post about the new features; meanwhile, you can get more information about the release in the Mapbox GL JS v3 migration guide. Excited to finally share this — many talented people worked very hard on this, so we'll appreciate your feedback! 🙏

image

✨ Features and improvements

  • Introduced a new 3D Lights API that supports directional and ambient light sources to give you control of lighting and shadows in your map when using 3D objects.
  • Added new APIs for fill-extrusion and other layers to support 3D lighting styling.
  • Added support for fill extrusion shadows.
  • Introduced flood lighting for both the walls of the extruded buildings and the ground beneath them.
  • Introduced ambient occlusion to affect the ground beneath the extruded buildings.
  • Introduced rounding fill extrusion edges for a smoother appearance.
  • Introduced the icon-image-cross-fade property, which controls the transitioning between the two variants of an icon image.
  • Introduced raster colorization via raster-color, raster-color-mix and raster-color-range paint properties.
  • Introduced hsl and hsla color expressions: These expressions allow you to define colors using hue, saturation, and lightness format.
  • Introduced random expression: Use this expression to generate random values, which can be particularly helpful for introducing randomness into your map data.
  • Introduced measureLight expression lights configuration property: Create dynamic styles based on lighting conditions.
  • Introduced config expression: Retrieves the configuration value for the given style option.
  • Introduced raster-value expression: Returns the raster value of a pixel computed via raster-color-mix.
  • Introduced distance expression: Returns the shortest distance in meters between the evaluated feature and the input geometry.
  • Introduced support for nested and configurable styles. You can now import other styles into your main style, with updates to imported styles automatically reflected in your main style. Configuration properties can be set for imported styles, making them customizable.
  • Introduced concept of slots, pre-specified locations in the style, where your layer can be added (e.g., on top of existing land layers but below all labels).
  • When no style option is provided to the Map constructor, the Mapbox Standard Style is now enabled as a default.

@mourner mourner added the skip changelog Used for PRs that do not need a changelog entry label Aug 7, 2023
@mourner mourner requested a review from a team as a code owner August 7, 2023 08:51
debug/measure-light.html Dismissed Show dismissed Hide dismissed
debug/shadows.html Dismissed Show dismissed Hide dismissed
alexey-romanov and others added 25 commits August 7, 2023 12:00
…ernal-440)

Emission is treated as a blend factor between lit & unlit modes.

emission = 0 -> 3D lights branch lit value
emission = 1 -> unlit value
* Add model style specification

Folder Scaffold for 3D style extension

* Added 3D tiled model source and fixed PR review comments

* Add model sources to api validation
* Add 3d-light specification

* Fix unit tests

* Fix lint

* Use array instead of object for lights, follow pattern of layer

* Add light properties

* Fix lint

* Add style specification validation tests

* Add style specification validation tests

* Move some files in 3d-style folder

* Fix flow
…nal-443)

* Relax restriction of zoom expression for atmosphere properties

* Update test cases

* Add render tests for zoom expression in atmosphere properties
* Revert change in terrain-debug.html for atmosphere configuration

* Add HSLA expression

* Add expression test cases
This is required by model layer because it uses a different coordinate space internally compared to other layers. Similar functionality is already included in the lighting prelude.
* Add light types

* Consolidate some redundant code

* Remove unused

* Remove model_style_layer generated file
* Expose star intensity for 3d playground

* [MAPS3D-763] move stars calculation under #ifdef block

There is a performance hit for certain mobile devices, even if stars intensity is set to zero. Unsupported branching.
* Add GLTF loader and scaffold structure

Added Gltf loder from loaders.gl and the bare minimum structure to start testing model parsing. So far it just parses the gltf model in the test, but it does not create gl buffers, textures or structures

* Review fixes

* Fix flow errors
…g (internal-457)

* Add lighting prelude

* Add lights uniforms

* Fork with LIGHTING_3D_MODE_NO_EMISSION until supported in gl-js

* Interpret light data and send uniforms

* Cleanup legacy lights

* Simplify codegen

* Add docs
* Add 3d lights render tests and update runtime API

* Prefer skip

* Update ignore lists
* Update baselines + fix some render tests

* Fix hillshade fixture

* Update render tests and ignore lists

* Update example
… conditionally in fill extrusion, ground shadow, and line fragment shaders (internal-461)
* Initial implementation of `raster-color`

* Clean up example and change order of operations in shader

* Move scale factors to a better location

* Clean up raster color configuration

* Formatting

* Build out demo page

* Fix test

* Move uniforms inside ifdef

* Update docs and minor code tweak for clarity

* Apply lint fixes

* Retrigger CI

* Partial linter, flow, and style spec fixes

* Fix flow type errors

* Apply PR feedback

* Remove rreusser tilesets from debug page

* Code review fixes

---------

Co-authored-by: Ricky Reusser <[email protected]>
…ternal-466)

* Remove unused fixtures

* Fixup

* Update asset path
* WIP: model conversion gltf to mapbox

* WIP: Model loading and naive rendering

* Fixes review comments

* Add linter to 3d-style and do a pass
…al-467)

* Perform 3D lighting computations in linear space
* update render tests
endanke and others added 20 commits August 7, 2023 12:00
* Refactor ModelManager to support scopes

* Fix ModelManager loading state
This message is being spawned too frequently because we have materials attached to the footprint meshes, after we clean those from the data we can re-enable this warning
* Add threshold for tile update on brightness change

* Iterate binders first in updatePaintArrays
* add runtime config options setting

* revert logical or assignment (not universally supported)

* extend setConfigProperty to accept importId

* remove leftover from merge conflict
* [MAPS3D-990] additional clipping for globe pole segments

Globe pole segments are currently tightly bound to tiles, causing absent pole segments whenever a corresponding tile is clipped.

This fix introduces an additional clipping step for pole segments when needed.

* globe pole clipping tests
* Add demo for data-driven measure-light value

* Use brightness value for initial evaluation in worker
…ternal-667)

* Add render test for landmark conflation

* Check buckets before reporting map to be loaded

 - Do not report map to be loaded before tiled 3D buckets have uploaded
   their data (there might be a one frame delay). Required fix for render tests

* Do not skip rendering of tiled 3D models during re-evaluation

* Ignore the new render test in webgl1
* Prepare for the v3.0.0-beta.1 release
* Add GL JS v3 changelog

* Update CHANGELOG.md

Co-authored-by: Volodymyr Agafonkin <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Volodymyr Agafonkin <[email protected]>

* Update Changelog

* Update CHANGELOG.md

Co-authored-by: Volodymyr Agafonkin <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Volodymyr Agafonkin <[email protected]>

* Add link to the migration guide

* Add bullet points on Style imports

* Remove mention of 3D models

---------

Co-authored-by: Volodymyr Agafonkin <[email protected]>
@mourner mourner merged commit 3eec46d into main Aug 7, 2023
6 checks passed
@mourner mourner deleted the v3 branch August 7, 2023 09:31
@brncsk
Copy link
Contributor

brncsk commented Aug 7, 2023

Just wanted to say that this is awesome. Been anticipating v3 for the better part of this year, watching @jonni_walker’s tweets as well as the ocasional work-in-progress branch showing up in the public repo :). Congrats, Mapbox folks, I’ve been playing with the beta for a couple of days now, but I’m only beginning to discover all the uncharted cartographic territory this release opens up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Used for PRs that do not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.