Commit Graph

97 Commits

Author SHA1 Message Date
John Firebaugh
bb8dd4705c [core] Fix fill layer z-fighting
Hand-ports b05e5ddd34
2017-09-12 08:22:08 -07:00
John Firebaugh
de91e68090 [core] Per-segment-per-layer vertex arrays
Reduces rebinding, matches gl-js, and works around the buggy VAO implementation on PowerVR SGX544 GPUs.
2017-07-17 09:19:02 -07:00
John Firebaugh
d618d4a274 [core] Dynamic program compilation for data-driven properties 2017-06-14 11:13:43 -07:00
Ivo van Dongen
3c175adf30 [core] split off render layers 2017-04-25 17:23:54 -07:00
John Firebaugh
0351e9c370 [core] Eliminate SpritePatternMode 2017-02-14 16:28:12 -06:00
John Firebaugh
d819ece74c [core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImage 2017-02-14 16:28:12 -06:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
John Firebaugh
67e157e8b4 [core] Move fill-outline special case to FillLayer::Impl::evaluate 2017-02-02 09:44:06 -08:00
John Firebaugh
38fcbe21d4 [core] Convert style properties to a tuple-based approach
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.
2016-11-17 15:13:38 -08:00
John Firebaugh
1db2ffbc1b [core] Use gl::Program to resolve some rough edges in the GL binding types
* 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.
2016-11-08 08:09:29 -08:00
John Firebaugh
66bdbc3b96 [core] Introduce gl::Program template 2016-11-08 08:09:29 -08:00
Konstantin Käfer
bd3d4bc89a [core] force explicit initialization of uniform values
force users to use the actual names to avoid implicit conversion accidentally targeting the wrong shader
2016-11-07 18:51:47 +01:00
Konstantin Käfer
ed72581e0c [core] remove Uniforms::value in favor of direct construction 2016-11-07 18:51:47 +01:00
John Firebaugh
0e57d10d77 [core] Modern C++ bindings for OpenGL 2016-10-28 17:14:01 -07:00
Konstantin Käfer
62b56b799a [core] change std::array<uint16_t, 2> to mbgl::Size 2016-10-27 18:30:58 -07:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00
Konstantin Käfer
5cc390d694 [core] separate Backend from View for headless rendering 2016-10-25 13:52:36 -07:00
John Firebaugh
21d7ee11e1 [core] Rationalize shader names
{layer type}{subtype}Shader
2016-10-06 14:47:58 -07:00
Konstantin Käfer
cc78b74098 [core] remove dependence on gl.h types 2016-09-29 10:17:47 -07:00
Konstantin Käfer
44c7e9d05e [core] merge gl::ObjectStore into gl::Context 2016-09-27 11:03:29 -07:00
Konstantin Käfer
ce42d22984 [core] rename gl::Config to gl::Context 2016-09-27 11:03:29 -07:00
Konstantin Käfer
afb93d4d3a [core] track VAOs and Buffers 2016-09-26 11:14:40 +02:00
Konstantin Käfer
85e222c825 [core] change bool overdraw to PaintMode::Overdraw 2016-09-07 17:56:38 +02:00
Konstantin Käfer
ff0c895eaa [core] change bool wrap/repeating to enum class SpritePatternMode 2016-09-07 17:56:38 +02:00
Bruno de Oliveira Abinader
c670b08ecb [core] Use PropertyValue<T> for Annotation line/fill 2016-07-13 11:57:09 +03:00
John Firebaugh
ae838b397b [core] Move translatedMatrix to RenderTile 2016-07-11 18:39:50 -07:00
John Firebaugh
a27b5586e5 [core] Pass RenderTile rather than individual parameters 2016-07-11 18:39:50 -07:00
John Firebaugh
6e77149c13 [core] Introduce PaintParameters
Use it to DRY selection of regular vs. overdraw shaders and VAOs.
2016-07-11 18:39:50 -07:00
John Firebaugh
822ec091da [core] Introduce non-anonymous Shaders class 2016-07-11 18:39:50 -07:00
Konstantin Käfer
4f26c8122a [core] track texture state to avoid redundand binds 2016-07-08 13:11:25 +02:00
Konstantin Käfer
69c529e264 [core] move shaders to anon struct and alias them 2016-07-07 15:06:59 +02:00
Bruno de Oliveira Abinader
f94b354b53 [core] Fix typo in shader outline pattern 2016-07-02 17:17:28 +03:00
Bruno de Oliveira Abinader
a17b0bcd82 [core] Fix overdraw mode on Linux
- Use glBindAttribLocation for GLSL attributes.
- Create a separate shader for each shader that supports overdraw.
  Needed because each uniform location must be known for every program.
- Create a separate VAO for each shader inside buckets.
  Needed because we can only bind a VAO to a specific shader.

Fixes #5435.
2016-07-01 19:47:35 +03:00
Bruno de Oliveira Abinader
97dffeb03d [core] s/Wireframe/Overdraw/g 2016-06-20 13:24:20 +03:00
Bruno de Oliveira Abinader
df5a395708 [core] Refactor wireframe to match JS overdraw mode 2016-06-20 13:24:20 +03:00
John Firebaugh
a020e535ca [core] Add a few conveniences to Color 2016-06-15 13:22:00 -07:00
Bruno de Oliveira Abinader
fc0f4edef3 [core] Fix sublayer depth when drawing stroke
Port from -js: 002c690712
2016-06-15 18:53:05 +03:00
Bruno de Oliveira Abinader
54e3aa185f [core] Cleaned up Painter::render{Background,Fill} 2016-06-15 18:53:05 +03:00
Bruno de Oliveira Abinader
814e516a4f [core] Separate pattern size from draw-time variables
Part of https://github.com/mapbox/mapbox-gl-shaders/issues/1.
2016-06-15 18:53:05 +03:00
Young Hahn
24b66bc8cd Color class (#5361)
* Color class

* Switch to list initialization
2016-06-15 11:38:22 -04:00
Bruno de Oliveira Abinader
9142c447e8 [tidy] Check llvm-namespace-comment
Ref: http://clang.llvm.org/extra/clang-tidy/checks/llvm-namespace-comment.html
2016-06-13 23:32:05 +03:00
Bruno de Oliveira Abinader
8b28b6ab6b [core] Renamed OutlineShader's color uniform
Part of https://github.com/mapbox/mapbox-gl-shaders/issues/8.
2016-06-07 15:04:02 +03:00
John Firebaugh
c902f9098b [core] Rationalize naming for style-related code 2016-06-02 14:51:39 -07:00
John Firebaugh
a43940afb2 [core] Runtime style layer API 2016-06-02 14:51:39 -07:00
Bruno de Oliveira Abinader
2038a21cb5 [core] s/GLObjectStore/ObjectStore/ 2016-06-01 13:53:39 +03:00
John Firebaugh
c568a8ad77 [core] Port "separate u_opacity from u_color"
0d34125196
1f5afa7db0
2016-05-25 21:37:58 -07:00
Bruno de Oliveira Abinader
7143408f69 [core] Implement MapDebugOptions::Wireframe
Together with MapDebugOptions::Collision, provides "wireframe" rendering
output so all drawn objects are visible. This mode ignores the line
width, background and fill colors for better visualization.

Fixes #4359.
2016-05-23 11:50:05 +03:00
Konstantin Käfer
ec70125e41 [core] move TileData and dependents to new *TileID classes 2016-05-10 14:50:56 +02:00
Konstantin Käfer
bdcbceff80 [core] move Tile to use UnwrappedTileID 2016-05-10 14:50:56 +02:00
Konstantin Käfer
dde59eaf76 [core] move Painter and dependents to new *TileID classes 2016-05-10 14:50:56 +02:00