Commit Graph

284 Commits

Author SHA1 Message Date
Olivier Guyot 9e55a8b2f0 Webgl / linting & test fixes 2019-09-25 17:22:36 +02:00
Olivier Guyot 23c2999cab Webgl points renderer / fix hit detection
Due to the fact that the points renderer does not know for sure
which attributes will be used for rendering, it is now mandatory
to provide both vertex/fragment shaders for rendering AND hit
detection.

The hit detection shaders should expect having an `a_hitColor`
that they should return to allow matching the feature uid.

This will be all one eventually by shader builders under the hood.
2019-09-25 12:11:09 +02:00
Olivier Guyot 2b36445ecc Webgl / Adapt the points renderer to use custom attributes
Now most attributes will be custom ones defined by the user of the renderer.
The hit detection is broken for now and still has to be fixed.
Also it is not possible anymore to give a texture to the renderer,
this will have to be fixed as well.
2019-09-25 10:11:27 +02:00
Olivier Guyot 30f19f8317 Webgl points renderer / terminates worker & dispose helper 2019-09-24 17:59:21 +02:00
Simon Seyock acac7a9403 remove skipFeature logic 2019-09-24 10:12:30 +02:00
ahocevar ebfb20440a Simplify events and store listeners only in one place 2019-09-04 16:48:43 +02:00
Tim Schaub 99462d3b53 Only get squared tolerance once per render 2019-08-17 07:10:10 -06:00
Tim Schaub abda7f4f1d Separate lookups for source tiles by tile coord and tile key 2019-08-13 16:40:01 -06:00
ahocevar e07ff9c04e Make zDirection configurable on tile source 2019-07-30 16:50:01 +02:00
jahow a0ff08b734 Webgl points / improve tests
Now testing with two features and adding a call to `prepareFrame`
without which the final render transform was off.
Also added a test with a pixelratio > 1.
2019-07-11 00:05:55 +02:00
Frederic Junod 933a6297bb Remove unused hasFeatureAtCoordinate from ol/renderer/Layer 2019-06-28 11:10:33 +02:00
Olivier Guyot 28b99767f8 Webgl points / read only one pixel for feature hit detection
Also implements `hasFeatureAtCoordinate`.

`hitTolerance` is not supported for now.
2019-06-28 09:12:20 +02:00
Olivier Guyot 1257ade199 Webgl renderer / rename function to avoid confusion
`getBlankTexture` was too close to `WebGLHelper#createTexture`
2019-06-28 09:12:20 +02:00
Olivier Guyot 8145b358c0 Webgl renderer / add id encode/decode utils 2019-06-28 09:06:16 +02:00
Olivier Guyot 9ae7256048 Merge pull request #9562 from jahow/webgl-worker
Optimize the WebGL points renderer using a worker
2019-06-06 08:48:29 +02:00
Olivier Guyot 2412fe0211 Webgl / remove handling of element_index_uint extension
From now on we will assume this extension is always enabled.

An error message have been added in the unlikely scenario of a lack
of support.
2019-06-05 14:46:15 +02:00
ahocevar 6123be726a Handle layer removal on shared containers 2019-06-02 13:59:06 +02:00
Frederic Junod 87d5f4c8bc Use 'helper' from WebGLHelper in tests 2019-06-01 15:35:31 +02:00
Olivier Guyot 698816030e Webgl points / fix unit tests 2019-06-01 15:33:36 +02:00
Olivier Guyot 532b8194b1 Webgl points / use the new typed-array based utils for buffers
`rebuildBuffer` is still a very CPU intensive task and is blocking the
main thread.
2019-06-01 15:20:04 +02:00
Olivier Guyot eb912d95ca Webgl / refactor utilities to work only on typed arrays
The base webgl renderer module now has two types of utilities:
* `writeXFeatureInstructions` will write a series of values in a given
typed array, which represent how a given feature will be rendered; for points,
this means position, size, color, etc.
* `writeXFeatureToBuffers` will fill up the given index & vertex buffers
with values based on the provided render instructions

As such, the logic for rendering features is:
user-input style > instructions array >(*) index/vertex buffers > draw

(*) this transformation is intended to be done on a worker.
2019-06-01 15:19:37 +02:00
Tim Schaub deb00f20fe Include full filename in import specifier 2019-05-29 08:51:10 -06:00
Frederic Junod 40c49a9ce5 Remove layerState param from prepareFrame and renderFrame function 2019-05-25 07:19:10 +02:00
ahocevar 7895b16043 Reuse container for raster and vector image layers 2019-05-22 16:47:20 +02:00
ahocevar 335648d613 Remove memory leak caused by label cache listeners 2019-05-16 21:04:55 +02:00
Olivier Guyot e11e3c5f6e Webgl / minor function renaming 2019-05-15 11:30:24 +02:00
Olivier Guyot c705775d75 Linting 2019-05-15 10:20:31 +02:00
Olivier Guyot 75eb62363a WebGL points / rebuild buffers only when extent changed 2019-05-15 10:18:47 +02:00
Olivier Guyot 523097903a WebGL points / rebuild buffers on every non animation frame 2019-05-15 10:18:22 +02:00
Olivier Guyot c6d214b585 Webgl / implement support for custom attributes in webgl buffers
Only numerical attributes can be pushed in webgl buffers.
2019-05-15 10:15:55 +02:00
Olivier Guyot 3a429d3f6c Webgl / add utils for pushing geojson geometries in webgl buffers
For now only point geometries are handled.
2019-05-15 09:44:41 +02:00
Olivier Guyot 5e36468245 Webgl / add a simple Layer renderer for common logic
This will eventually provides utilities for manipulating & rendering data
2019-05-15 09:43:29 +02:00
Olivier Guyot a2d83f5358 WebGL points / add minimal tests 2019-05-15 09:42:15 +02:00
ahocevar 12289b8ef9 Declutter in correct order and for all layers 2019-05-05 12:20:38 +02:00
ahocevar dde9c59021 Use nearest lower resolution of vector tiles 2019-04-26 14:29:09 +02:00
Andreas Hocevar 10a2b718f5 Merge pull request #9286 from ahocevar/interim-transition
Disable transition when an interim tile is available
2019-04-05 17:33:58 +02:00
ahocevar 3940b5ec88 Show only one world 2019-03-25 14:49:13 +01:00
ahocevar cb2b57232c Add tests 2019-03-12 08:11:17 +01:00
ahocevar b2722542fe Simplify vector tile projection handling 2019-03-10 09:37:58 +01:00
ahocevar 56f37ab347 Disable transition when an interim tile is available 2019-03-03 23:07:46 +01:00
ahocevar 667cadc403 Remove extent default so we catch errors when extent is not set 2019-02-18 12:07:10 +01:00
ahocevar 90c8fc7888 Properly unregister prepareTile listeners 2019-01-13 23:09:24 +01:00
ahocevar 54f48e9c03 Re-add missing import after rebase 2019-01-09 13:45:01 +01:00
ahocevar 0f3c0d1af4 Rename VectorImageTile to VectorRenderTile 2019-01-09 13:45:01 +01:00
ahocevar 32696638d2 Simplify vector tile code 2019-01-09 13:45:01 +01:00
ahocevar ab797b7160 Let source set the key, like other sources do 2019-01-08 13:44:20 +01:00
ahocevar 523d3a4e8c Let the source load source tiles 2019-01-08 13:44:19 +01:00
Frederic Junod 5195adea85 Remove 'layerStates' property from the FrameState 2018-12-18 09:49:38 +01:00
Andreas Hocevar 0cda18f58a Merge pull request #9008 from ahocevar/decouple-group-creation
Decouple render instruction creation from rendering
2018-12-07 14:33:54 +01:00
ahocevar df59b894b1 Make tile keys stable to avoid TileQueue confusion 2018-12-04 11:09:51 +01:00