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 / Filter geometries before processing them for rendering #15416

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jahow
Copy link
Contributor

@jahow jahow commented Dec 8, 2023

This PR introduces a filter() method on the MixedGeometryBatch class. Before generating WebGL buffers from a geometry batch, the VectorStyleRenderer will apply the style filter and exclude from the batch any geometry that does not match this filter. The style filter expression is evaluated on the CPU.

Some filters might not be evaluated at buffer generation time (e.g. a filter depending on time or resolution which are dynamic parameters). This entails that the filter is also still applied on the GPU (fragment shader) to make sure that we filter our all relevant features at any given frame.

This change typically makes vector tiles processing a little bit longer, but is essential when rendering styles composed of dozens of different rules where it provides a huge performance boost.

Rebased on #15415

Part of #15413

Copy link

github-actions bot commented Dec 8, 2023

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

Evaluation contexts are now initialized with every properties set to
UNKNOWN_VALUE.

If an expression needs an input which is unknown, it will return UNKNOWN_VALUE.
Also added some tests for string assertion
This makes sure that icons are loaded before rendering
This will be used to filter out features that will eventually be rendered
@jahow jahow force-pushed the webgl-filter-geometry-earlier branch from 3bef70a to 6cc7405 Compare December 15, 2023 10:34
@jahow jahow force-pushed the webgl-filter-geometry-earlier branch from 6cc7405 to 8166059 Compare December 22, 2023 13:27
@jahow jahow force-pushed the webgl-filter-geometry-earlier branch from 8166059 to ce9daca Compare December 22, 2023 13:53
@jahow
Copy link
Contributor Author

jahow commented Dec 22, 2023

I added some missing tests, still very much open to suggestions and ideas on this! thanks!!

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