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

WebGL / Implement tile masking for vector tiles #15127

Merged
merged 5 commits into from Sep 14, 2023

Conversation

jahow
Copy link
Contributor

@jahow jahow commented Sep 14, 2023

This PR implements the concept of tile masking for the WebGL Vector Tile renderer. This allows a cleaner visible output by making sure that tiles of lower zoom levels will not show through tiles of higher zoom levels.

Also got rid of the flickering effect that used to be very noticeable.

This PR also changes the API of the VectorStyleRenderer class by not allowing full explicit shaders as string anymore, but instead taking in a ShaderBuilder instance that was preconfigured.

See an example of higher tiles masking lower ones:
image

@jahow jahow force-pushed the webgl-vector-tiles-no-overlap branch from 2775a06 to 8fd38d7 Compare September 14, 2023 09:29
@github-actions
Copy link

📦 Preview the website for this branch here: https://deploy-preview-15127--ol-site.netlify.app/.

@jahow jahow force-pushed the webgl-vector-tiles-no-overlap branch from 8fd38d7 to e2dd80e Compare September 14, 2023 09:40
@jahow jahow force-pushed the webgl-vector-tiles-no-overlap branch 9 times, most recently from f251e47 to 9ce6106 Compare September 14, 2023 10:46
The eliminates the flickering for vector tiles, which happened because there
is a delay between a tile being loaded (i.e. having its data loaded) and its
buffers ready for rendering.
It is not possible anymore to provide full explicit shaders to the
VectorStyleRenderer class, as this would most likely break very often.
Instead, a preconfigured builder should be provided.

Note: a literal style can still be provided as well.
This will not be run by default, unless beforeTilesMaskRender returns true
The tile mask is a render target that contains the values of the highest drawn
zoom level for each pixel. This can then be used when rendering the actual
tiles to mask tiles below the highest ones, thus avoiding overlapping.

Also added support for depth in ShaderBuilder.
@jahow jahow force-pushed the webgl-vector-tiles-no-overlap branch from 9ce6106 to e691cf3 Compare September 14, 2023 18:19
@jahow jahow merged commit 8624765 into openlayers:main Sep 14, 2023
8 checks passed
@jahow jahow deleted the webgl-vector-tiles-no-overlap branch September 14, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants