-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add data driven styling for circle-color and circle-radius #1932
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lucaswoj
force-pushed
the
data-driven-styling
branch
3 times, most recently
from
January 14, 2016 20:58
263def1
to
27e0443
Compare
lucaswoj
force-pushed
the
data-driven-styling
branch
2 times, most recently
from
January 19, 2016 22:07
666f7ca
to
4e58abc
Compare
lucaswoj
force-pushed
the
data-driven-styling
branch
3 times, most recently
from
January 27, 2016 21:46
2b01616
to
4520a6f
Compare
Closed
lucaswoj
force-pushed
the
data-driven-styling
branch
from
February 17, 2016 22:22
4520a6f
to
2da2bdb
Compare
lucaswoj
force-pushed
the
data-driven-styling
branch
3 times, most recently
from
March 3, 2016 00:22
b3e4975
to
c9b0d8f
Compare
lucaswoj
force-pushed
the
data-driven-styling
branch
5 times, most recently
from
March 10, 2016 00:58
44bd38e
to
be1e88a
Compare
lucaswoj
changed the title
Add data driven styling for circle-color [DO NOT MERGE]
Add data driven styling for circle-color
Mar 11, 2016
lucaswoj
force-pushed
the
data-driven-styling
branch
2 times, most recently
from
March 15, 2016 20:14
1072da4
to
ce7fc2b
Compare
Using macros and preprocessor directives is the glsl way of doing this. After this the .glsl files are now valid glsl. I think it's clearer to have both variations explicitly written in glsl than having string replacement.
This replaces a per-attribute `isDisabled` function with paint property key. All data-driven attributes must now depend on only a single paint property. The `a_color` attribute used to depend on both the `circle-color` and `circle-opacity` paint properties. This splits them up into two attributes/uniforms, each of which only depends on one paint property. I think it will be simpler to have all attributes be based on a single style property. We will need to split up: - a_color, which depends on -color and -opacity - u_linewidth, which depends on line-width and line-width-gap
This prepares the shaders for the switch to data driven styling where opacity and color need to be passed to the shader independent of eachotehr. remove the `additionalOpacity` parameter from `util.premultiply`
A function of the layer, globalProperties, featureProperties is simpler than a string of code that gets joined into a function. This separates the vertex push method for core attributes from the push methods for data-driven attributes. This will let us: - use a regular function for adding core attributes to buffers - and either: - generate a separate method for data driven attributes - or optimize adding attributes without code generation Data driven properties need to be evaluated once per feature, not once per vertex. This means we can evaluate them outside the main vertex loop and then add the same value for every vertex. The hot loop for lines, fills and symbols will be: for (var i = startIndex; i < endIndex; i++) { ... } If it's too slow in the current implementation we could add new StructArray methods for setting a single value for a range of elements. If we need to generate code it would be nice to contain that to StructArray.
Now that paint attributes are added separately, we can switch to using regular functions instead of code strings that are joined into a method. This removes more code generation and it reduces the responsibility of the `Bucket` parent class.
It's simpler to just add directly to the arrays.
- avoids the need to namespace attribute names with string concatenation - this let's us use attribute.name as the shader attribute name - this will let us use instanced rendering (#1898) with a shorter buffer when that extension is available.
since it no longer needs access to anything in Bucket Set attribute pointers using info from the array type.
lucaswoj
force-pushed
the
data-driven-styling
branch
from
April 12, 2016 21:40
b35ddd0
to
31dc4ac
Compare
This was referenced Apr 12, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch adds data-driven styling for
circle-color
.Follow Up Tasks
mapbox-gl-function
branchmapbox-gl-style-spec
branchmapbox-gl-test-suite
branchBucket
class into smaller units