summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/symbol_program.hpp
Commit message (Collapse)AuthorAgeFilesLines
* [core] Double maximum label width by reducing glyph precision.Chris Loer2018-03-221-2/+2
| | | | | Fixes issue #11507. Port of GL JS PR #6375.
* [core] Update shaders/tests from GL JS.Chris Loer2017-11-171-12/+22
|
* Implement Expressions (#9439)Anand Thakker2017-11-081-40/+11
| | | Ports https://github.com/mapbox/mapbox-gl-js/pull/4777 (and its several follow-ups)
* [core] No need for optional in map of VertexArraysJohn Firebaugh2017-07-121-4/+4
|
* [core] Per-segment-per-layer vertex arraysJohn Firebaugh2017-07-121-4/+7
| | | | Reduces rebinding, matches gl-js, and works around the buggy VAO implementation on PowerVR SGX544 GPUs.
* [core] Rework attribute binding (again)John Firebaugh2017-07-121-17/+29
| | | | | | | | | | These changes are necessary for programs whose set of active attributes is not fixed at compile time by a template parameter pack, but rather varies based on the generated shader text at runtime. In such cases, the attribute location of a given named attribute may vary between instances of the same Program. Previously, attribute bindings were implicitly associated with a location based on template parameter order, and -1 was used to indicate an inactive attribute. This left us unable to disable the appropriate attribute when it went from active to inactive. Now, the state tracker for bindings explicitly associates locations and state, and an empty optional is used to indicate an inactive attribute. In addition, a gl::VertexArray class is now exposed, allowing more flexibility in the relationship between Programs, Segments, and attribute bindings. In this commit, that relationship does not change, but the subsequent commit adjusts it to match gl-js, reduce rebinds, and work around buggy VAO implementations. VertexArray uses a pimpl idiom in order to support implementations that lack the VAO extension. In that case, all VertexArrays share global binding state, reflecting the platform reality in the absence of VAOs, while still providing a uniform API.
* [core] Update shaders.Chris Loer2017-07-121-1/+9
| | | | | Implements 'icon-pitch-alignment' (issue #9345) Fixes issue #9456 (map-aligned point label regression)
* [core] improve legibility of labels that follow linesAnsis Brammanis2017-07-111-128/+75
| | | | | | | | | | port https://github.com/mapbox/mapbox-gl-js/pull/4781 This improves legibility of labels that follow lines in pitched views. The previous approach used the limited information in the shader to calculate put the glyph in approximatelyright place. The new approach does this more accurately by doing it on the cpu where we have access to the entire line geometry.
* [core] Use fade texture in collision debug boxes so that they agree more ↵Chris Loer2017-07-111-1/+0
| | | | closely with symbol shaders.
* [core] Pass pitch-scaling vertex attributes and uniforms to shaders.Chris Loer2017-07-111-4/+17
|
* [core] Improved label pitch-scaling: approximate collision box shapes based ↵Chris Loer2017-07-111-1/+5
| | | | on tile distance from camera.
* [core] Implement circle-pitch-alignment propertyChris Loer2017-07-061-1/+0
| | | | Closes issue #9349.
* [core] Eliminate constant attribute bindingsJohn Firebaugh2017-06-141-5/+6
| | | | Rather than binding constant attributes that will never be used, just disable the attribute.
* [core] Don't use "current" icon/text-size when bindingJohn Firebaugh2017-06-141-16/+5
| | | | | | The current value is not passed to `SymbolSizeBinder::uniformValues`, so we shouldn't check `currentValue.isConstant()` in `SymbolSizeBinder::attributeBindings`. If it were true, then we might end up using attribute bindings that are appropriate only for a constant property, but uniform bindings that are appropriate only for a source or composite function. Instead, just wait for a new bucket to be generated. This will happen automatically, since icon/text-size are layout properties.
* [core] Dynamic program compilation for data-driven propertiesJohn Firebaugh2017-06-131-1/+2
|
* [core] add constant DDS values as uniformsKonstantin Käfer2017-06-131-1/+1
|
* Fix undefined memory access in getCoveringRanges() (#9227)Anand Thakker2017-06-091-3/+4
| | | | | | | | | | | | * Add simple unit tests for SymbolSizeBinder * Fix bug in symbol size uniform value calculation For camera functions we were setting the zoom levels in "covering ranges" to `[(zoom stop <= tile zoom), (zoom stop >= 1 + tile zoom)]`, but then evaluating the function at `[tile_zoom, tile_zoom + 1]`. * Check for it != end() before accessing it->first
* [core] Move pattern coordinate division by texture size into shaderJohn Firebaugh2017-05-231-1/+0
| | | | This makes pattern usage more like icons, and will be necessary for data-driven *-pattern properties.
* [core] add error for non-virtual destructor deletes + add virtual dtorsKonstantin Käfer2017-05-181-3/+5
|
* [core] Remove obsolete modular arithmetic on atlas coordinatesJohn Firebaugh2017-05-171-2/+2
| | | | We switched to 16-bit coordinates in attributes in b0cb8715ed74678b4d0f05829fa71a590e41b2f6, so there's no longer any reason to require that they are divisible by four.
* [core] Unify {Paint,Layout,Light}PropertiesJohn Firebaugh2017-05-151-1/+1
|
* [core] Move renderer/* files into sub-folders (#8983)Asheem Mamoowala2017-05-121-1/+1
| | | Move renderer/* files into sub-folders
* [core] Move render-related sources out of style directory/namespaceJohn Firebaugh2017-05-031-5/+5
| | | | | | | | | | | | | | | | Moves the following to the renderer directory and out of the style namespace: * CascadeParameters * PropertyEvaluationParameters * UpdateParameters * PropertyEvaluator * DataDrivenPropertyEvaluator * CrossFadedPropertyEvaluator * PaintPropertyBinder * PaintProperyStatistics * PossiblyEvaluatedPropertyValue * TransitioningLight * EvaluatedLight
* [core] split off render layersIvo van Dongen2017-04-251-0/+1
|
* [core] Add DDS support for {text,icon}-size (#8593)Anand Thakker2017-04-061-19/+337
| | | | | | | | | | | | | | | | | | | | | | | | * Update gl-js and generate style code * Factor out packUint8Pair() helper function * Draft implementation of DDS for {text,icon}-size Ports https://github.com/mapbox/mapbox-gl-js/pull/4455 * Fix text-size/composite-function-line-placement test * Refactor to PaintPropertyBinders-like strategy * Dedupe gl::Program construction * Use exponential function base for interpolation * Dedupe coveringZoomStops method * Fixup tests * Fix CI errors (hidden within #if block)
* Pack min + max into one attribute :muscle:Molly Lloyd2017-03-081-5/+3
| | | | | | | | Some devices supported by Mapbox GL provide only 8 vertex attributes; this change packs existing attributes to get us just under that limit. For properties using a composite function, pack the min and max values into a single attribute with two logical components instead of using two separate attributes and buffers. Special logic is included for color attributes, whose integer components must be packed into the available bits of floating-point attributes. (We don't have access to ivec types in GL ES 2.0.) For source functions, continue to bind just a one-component attribute even though the GLSL type is vec2 (or vec4 for colors). The type-checking done by gl::Attribute is relaxed slightly to accommodate this.
* [core] Implement data-driven styling for ↵Anand Thakker2017-02-281-25/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | {text,icon}-{color,opacity,halo-color,halo-blur,halo-width} (#7939) * Add symbol dds attributes and adapt style code generation * Update to mapbox-gl-js/master * Refactor SymbolFeature as a subclass of GeometryTileFeature Prepares for enabling DDS on symbol paint properties by allowing the SymbolFeatures, which we keep around after constructing SymbolLayout, to be used in evaluating data-driven paint properties later in the layout process. * Draft approach for splitting icon/text paint properties The `Program` types are set up to bind GL attributes to each of the data-driven paint properties specified in the `PaintProperties` type provided. Since `SymbolPaintProperties` specifies both `Text*` and `Icon*` properties, the symbolIcon, symbolIconSDF, and symbolGlyph programs each attempt to bind roughly double the number of attributes that they actually need. This change addresses this by: - Adding the more specific `IconPaintProperties` and `TextPaintProperties` types, which are subsets of the full `SymbolPaintProperties`. - The symbol layer continues to use its `SymbolPaintProperties paint` member to track layer property state, but it provides helpers that construct objects of each the specific `{Icon,Text}PaintProperties::Evaluated` type, for use by the painter. - The three symbol programs instantiate `Program<>` using the appropriate `{Icon,Text}PaintProperties` type. * check in generated style code * Populate paint buffers for symbol DDS properties * Address first round of review comments * Refactor VectorTile{Layer,Feature} to explicitly share data * Update submodule
* [core] Check in generated shader codeJohn Firebaugh2017-02-071-2/+2
| | | | One step toward eliminating the node/npm dependency for platforms other than node.
* [core] Add support for data-driven stylingJohn Firebaugh2017-02-021-16/+20
|
* [core] Use gl::Program to resolve some rough edges in the GL binding typesJohn Firebaugh2016-11-081-0/+2
| | | | | | | | | * Extract `ignore` util to separate header. * `Segment` now tracks offset and length of indices, rather than primitives. This is more natural. * Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering. * `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms. * Use the debug shaders for debug tile rendering, like gl-js. * Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
* [core] Introduce gl::Program templateJohn Firebaugh2016-11-081-0/+134