summaryrefslogtreecommitdiff
path: root/src/mbgl/programs
Commit message (Collapse)AuthorAgeFilesLines
* [core] improve legibility of labels that follow linesAnsis Brammanis2017-07-114-137/+107
| | | | | | | | | | 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-113-2/+3
| | | | closely with symbol shaders.
* [core] Set "max_camera_distance" to 1.5 for viewport-aligned road labels.Chris Loer2017-07-111-1/+1
| | | | Viewport-aligned curved labels start to look very strange in the distance. Until we have a better system for projecting them, just prevent them from showing.
* [core] Pass pitch-scaling vertex attributes and uniforms to shaders.Chris Loer2017-07-116-9/+36
|
* [core] Improved label pitch-scaling: approximate collision box shapes based ↵Chris Loer2017-07-112-1/+7
| | | | on tile distance from camera.
* [core] Implement circle-pitch-alignment propertyChris Loer2017-07-063-2/+5
| | | | Closes issue #9349.
* [core] Enable property functions for line-width (#9250)Lauren Budorick2017-06-194-20/+20
|
* [core] Eliminate constant attribute bindingsJohn Firebaugh2017-06-142-6/+7
| | | | Rather than binding constant attributes that will never be used, just disable the attribute.
* [core] rename a_gap_width => a_gapwidth, u_gap_width => u_gapwidth to ↵Konstantin Käfer2017-06-142-2/+2
| | | | | | reflect naming in the shader not sure how this ever worked
* [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-135-28/+81
|
* [core] cleanup ProgramParametersKonstantin Käfer2017-06-133-10/+41
|
* [core] add constant DDS values as uniformsKonstantin Käfer2017-06-132-2/+2
|
* [core] add uniforms to DataDrivenPaintPropertysKonstantin Käfer2017-06-131-1/+13
|
* [core] Per-bucket icon atlasesJohn Firebaugh2017-06-136-18/+18
|
* 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] Simplify and fix sprite atlas coordinate calculationsJohn Firebaugh2017-05-234-24/+24
| | | | | | | | * Always return image metrics exclusive of padding * Work with integer coordinates whenever possible * Eliminate redundant SpriteAtlasElement members * Fix asymmetric re-padding in getIconQuad when pixelRatio != 1 * Add explanatory comments
* [core] Move pattern coordinate division by texture size into shaderJohn Firebaugh2017-05-239-2/+14
| | | | 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-172-3/+3
| | | | 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-157-12/+15
|
* [core] Move renderer/* files into sub-folders (#8983)Asheem Mamoowala2017-05-121-1/+1
| | | Move renderer/* files into sub-folders
* [tidy] modernize-pass-by-valueBruno de Oliveira Abinader2017-05-123-5/+7
|
* [core] Move render-related sources out of style directory/namespaceJohn Firebaugh2017-05-035-18/+12
| | | | | | | | | | | | | | | | 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] Render fill-extrusion layers (#8431)Lauren Budorick2017-04-278-9/+271
|
* [core] split off render layersIvo van Dongen2017-04-251-0/+1
|
* [core] Add DDS support for {text,icon}-size (#8593)Anand Thakker2017-04-066-94/+400
| | | | | | | | | | | | | | | | | | | | | | | | * 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)
* [core] cache binary shaders on AndroidKonstantin Käfer2017-03-225-11/+226
|
* [core] Fix overspecialization of PaintPropertyBinder templateJohn Firebaugh2017-03-171-143/+38
| | | | | | | | | | | | | | | | | | PaintPropertyBinder and subclass templates were being instantiated for every unique attribute type (e.g. a_color, a_fill_color, a_halo_color) even though they behave identically for a given property value type (e.g. Color). To fix this, a unique type such as a_color no longer derives from gl::Attribute<...> -- instead it has an inner Type typedef, which should be used wherever neither a unique type nor attribute name is required. This reduces binary size substantially: VM SIZE FILE SIZE ++++++++++++++ GROWING ++++++++++++++ -------------- SHRINKING -------------- -2.0% -49.3Ki __TEXT,__text -49.3Ki -2.0% -3.1% -5.21Ki [None] -2.79Ki -1.6% -2.1% -4.12Ki __TEXT,__const -4.12Ki -2.1% -1.4% -4.04Ki __TEXT,__gcc_except_tab -4.04Ki -1.4% -19.3% -3.62Ki __DATA,__data -3.62Ki -19.3% -2.5% -1.65Ki __TEXT,__unwind_info -1.65Ki -2.5% -4.2% -8 __DATA,__mod_init_func 0 [ = ] -1.9% -68.0Ki TOTAL -65.6Ki -1.9%
* [core] Don't need to use normalized attributes anymoreJohn Firebaugh2017-03-171-5/+4
|
* [core] Extract and de-templatize several Program static methodsJohn Firebaugh2017-03-091-27/+4
|
* Pack min + max into one attribute :muscle:Molly Lloyd2017-03-082-51/+53
| | | | | | | | 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] De-duplicate shader prelude sourceJohn Firebaugh2017-03-081-2/+3
|
* [core] Implement data-driven styling for ↵Anand Thakker2017-02-284-94/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | {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] Combine SpriteAtlas::getPosition with SpriteAtlas::getImageJohn Firebaugh2017-02-144-10/+10
|
* [core] Check in generated shader codeJohn Firebaugh2017-02-077-13/+13
| | | | One step toward eliminating the node/npm dependency for platforms other than node.
* [core] Add support for data-driven stylingJohn Firebaugh2017-02-0215-160/+338
|
* [core] remove trailing whitespace, add trailing newlines, add space after //Konstantin Käfer2017-01-271-1/+1
|
* [core] fix rendering 180° line joinsKonstantin Käfer2017-01-231-1/+1
|
* [core] Update gl-js for shader changeJohn Firebaugh2016-12-231-4/+3
|
* [core] clearer pitched line antialiasingAnsis Brammanis2016-12-212-22/+17
| | | | | | | | | | ported from -js: ef5582dd3bc5c15a3112e875ed66494dab8e9d0b Project the extrusion and compare it's projected pixel length with the actual pixel length and adjust antialiasing accordingly. The previous approach calculated the adjustment much more indirectly and had no intuitive explanation.
* [core, ios] replace `altitude` with `fov`Ansis Brammanis2016-12-212-4/+4
| | | | | | | | | ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19 `altitude` was a terribly-named variable that was used to indirectly control the fov. This should eliminate some confusion. `altitude` was equivalent to `cameraToCenterDistance / height`
* [core] fix text blurriness at different FOVsAnsis Brammanis2016-12-211-2/+2
| | | | | | | | | | | | | | | | | ported from -js: c52a09639ceeeb809cd837360993df9c45b45420 This replaces a hardcoded shader approximation with a more correct, FOV-dependent one. `gl_Position.w - 0.5` is replaced with `gl_Position.w / tan(fov)` The `/ tan(fov)` is handled by multiplying `1 / tan(fov)` into `u_gamma` outside the shader. I think `- 0.5` was just chosen as something that looked right for the default fov.lease enter the commit message for your changes. Lines starting
* [core] Implement circle-stroke propertiesJohn Firebaugh2016-12-091-0/+6
| | | | Also includes stubs for fill-extrusion layer, because most of the code was auto-generated.
* [core] Move CrossFadedPropertyEvaluator to its own fileJohn Firebaugh2016-12-061-1/+1
|
* Always use a dot as a decimal point in string, independent of localeAki Koskinen2016-11-291-1/+6
| | | | | | | std::to_string() potentially uses a decimal point character different than a dot (.), depending on the environment's locale. But since this generated string will be part of GLSL code, there needs to be a dot and nothing else.
* [core] Convert style properties to a tuple-based approachJohn Firebaugh2016-11-172-27/+28
| | | | | | | | This converts the style property classes (CirclePaintProperties and so on) to the same tuple-based approach as gl::Attribute and gl::Uniform. The approach is outlined in https://github.com/mapbox/cpp/blob/master/C%2B%2B%20Structural%20Metaprogramming.md. The main advantage of this approach is it allows writing algorithms that work on sets of style properties, without resorting to code generation or manually repetitive code. This lets us iterate on approaches to data-driven properties more easily. Another advantage is that the cascading, unevaluated, and evaluated states of a set of properties exist as independent structures, instead of individual properties holding their own state. This is a more functional approach that makes data flow clearer and reduces state.
* [core] update native for line property function shaders changes (#6658)Molly Lloyd2016-11-166-55/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [core] update shaders for line property functions update deps, define device pixel ratio for all shaders [core] create ShaderParameter struct to store pixel ratio and overdraw param repair rebase errs update shaders to include pixel ratio make sure collision_box never overdraws update test suite, move shaders to Painter::render so the correct pixel ratio is applied move shader compiling back to the Painter constructor rebase from shader --> program refactor re-factor parameters for collisionBox and debug programs remove unused vars from line-program, move blur math to shader update core files remove unecessary files update shaders PR, remove comments bump test suite sha fix formatting, incorporate feedback refactor program.hpp * [core] remove line transformations that were moved to the shaders, bump shader sha * [core] shorten ProgramParameter instantiation * [core] bump shader+test suite shas
* [core] Introduce SegmentVectorJohn Firebaugh2016-11-154-11/+21
|
* [core] Use gl::Program to resolve some rough edges in the GL binding typesJohn Firebaugh2016-11-089-3/+43
| | | | | | | | | * 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.