From 2d799cc74a0f1c845d436b3bc23fce7ec70dbf49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 15 Mar 2019 10:02:47 +0100 Subject: [core] make Program interface backend-agnostic --- scripts/generate-shaders.js | 138 ++-- src/core-files.json | 104 ++- src/mbgl/gfx/context.hpp | 17 +- src/mbgl/gfx/context_impl.hpp | 23 + src/mbgl/gfx/program.hpp | 6 +- src/mbgl/gfx/types.hpp | 4 + src/mbgl/gl/context.cpp | 2 +- src/mbgl/gl/program.hpp | 16 +- src/mbgl/programs/background_pattern_program.hpp | 4 + src/mbgl/programs/background_program.cpp | 4 + src/mbgl/programs/background_program.hpp | 9 +- src/mbgl/programs/circle_program.cpp | 3 + src/mbgl/programs/circle_program.hpp | 4 +- src/mbgl/programs/clipping_mask_program.cpp | 8 + src/mbgl/programs/clipping_mask_program.hpp | 2 - src/mbgl/programs/collision_box_program.cpp | 4 + src/mbgl/programs/collision_box_program.hpp | 24 +- src/mbgl/programs/collision_circle_program.hpp | 4 + src/mbgl/programs/debug_program.cpp | 8 + src/mbgl/programs/debug_program.hpp | 2 - src/mbgl/programs/extrusion_texture_program.cpp | 3 + src/mbgl/programs/extrusion_texture_program.hpp | 2 - .../programs/fill_extrusion_pattern_program.hpp | 4 + src/mbgl/programs/fill_extrusion_program.cpp | 4 + src/mbgl/programs/fill_extrusion_program.hpp | 6 +- src/mbgl/programs/fill_outline_pattern_program.hpp | 4 + src/mbgl/programs/fill_outline_program.hpp | 4 + src/mbgl/programs/fill_pattern_program.hpp | 4 + src/mbgl/programs/fill_program.cpp | 6 + src/mbgl/programs/fill_program.hpp | 10 +- src/mbgl/programs/gl/background.cpp | 47 ++ src/mbgl/programs/gl/background_pattern.cpp | 78 ++ src/mbgl/programs/gl/circle.cpp | 300 +++++++ src/mbgl/programs/gl/clipping_mask.cpp | 40 + src/mbgl/programs/gl/collision_box.cpp | 77 ++ src/mbgl/programs/gl/collision_circle.cpp | 100 +++ src/mbgl/programs/gl/debug.cpp | 42 + src/mbgl/programs/gl/extrusion_texture.cpp | 52 ++ src/mbgl/programs/gl/fill.cpp | 104 +++ src/mbgl/programs/gl/fill_extrusion.cpp | 142 ++++ src/mbgl/programs/gl/fill_extrusion_pattern.cpp | 241 ++++++ src/mbgl/programs/gl/fill_outline.cpp | 112 +++ src/mbgl/programs/gl/fill_outline_pattern.cpp | 186 +++++ src/mbgl/programs/gl/fill_pattern.cpp | 174 ++++ src/mbgl/programs/gl/heatmap.cpp | 141 ++++ src/mbgl/programs/gl/heatmap_texture.cpp | 55 ++ src/mbgl/programs/gl/hillshade.cpp | 93 +++ src/mbgl/programs/gl/hillshade_prepare.cpp | 117 +++ src/mbgl/programs/gl/line.cpp | 253 ++++++ src/mbgl/programs/gl/line_gradient.cpp | 235 ++++++ src/mbgl/programs/gl/line_pattern.cpp | 322 ++++++++ src/mbgl/programs/gl/line_sdf.cpp | 315 +++++++ src/mbgl/programs/gl/preludes.cpp | 15 + src/mbgl/programs/gl/preludes.hpp | 14 + src/mbgl/programs/gl/raster.cpp | 103 +++ src/mbgl/programs/gl/shader_source.cpp | 471 +++++++++++ src/mbgl/programs/gl/shader_source.hpp | 13 + src/mbgl/programs/gl/shaders.cpp | 31 + src/mbgl/programs/gl/shaders.hpp | 18 + src/mbgl/programs/gl/symbol_icon.cpp | 162 ++++ src/mbgl/programs/gl/symbol_sdf_icon.cpp | 317 +++++++ src/mbgl/programs/gl/symbol_sdf_text.cpp | 317 +++++++ src/mbgl/programs/heatmap_program.cpp | 3 + src/mbgl/programs/heatmap_program.hpp | 4 +- src/mbgl/programs/heatmap_texture_program.cpp | 3 + src/mbgl/programs/heatmap_texture_program.hpp | 2 - src/mbgl/programs/hillshade_prepare_program.cpp | 3 + src/mbgl/programs/hillshade_prepare_program.hpp | 2 - src/mbgl/programs/hillshade_program.cpp | 3 + src/mbgl/programs/hillshade_program.hpp | 4 +- src/mbgl/programs/line_gradient_program.hpp | 4 + src/mbgl/programs/line_pattern_program.hpp | 4 + src/mbgl/programs/line_program.cpp | 6 + src/mbgl/programs/line_program.hpp | 10 +- src/mbgl/programs/line_sdf_program.hpp | 4 + src/mbgl/programs/program.hpp | 25 +- src/mbgl/programs/programs.cpp | 2 +- src/mbgl/programs/programs.hpp | 4 +- src/mbgl/programs/raster_program.cpp | 3 + src/mbgl/programs/raster_program.hpp | 4 +- src/mbgl/programs/symbol_icon_program.hpp | 4 + src/mbgl/programs/symbol_program.cpp | 5 + src/mbgl/programs/symbol_program.hpp | 29 +- src/mbgl/programs/symbol_sdf_icon_program.hpp | 4 + src/mbgl/programs/symbol_sdf_text_program.hpp | 4 + .../renderer/layers/render_background_layer.cpp | 3 +- src/mbgl/renderer/layers/render_circle_layer.cpp | 2 + .../layers/render_fill_extrusion_layer.cpp | 3 +- src/mbgl/renderer/layers/render_fill_layer.cpp | 2 + src/mbgl/renderer/layers/render_heatmap_layer.cpp | 2 + .../renderer/layers/render_hillshade_layer.cpp | 2 + src/mbgl/renderer/layers/render_line_layer.cpp | 2 + src/mbgl/renderer/layers/render_raster_layer.cpp | 2 + src/mbgl/renderer/layers/render_symbol_layer.cpp | 2 + src/mbgl/renderer/render_static_data.cpp | 1 + src/mbgl/renderer/render_static_data.hpp | 1 + src/mbgl/renderer/render_tile.cpp | 1 + src/mbgl/renderer/sources/render_image_source.cpp | 1 + src/mbgl/shaders/background.cpp | 41 - src/mbgl/shaders/background.hpp | 16 - src/mbgl/shaders/background_pattern.cpp | 72 -- src/mbgl/shaders/background_pattern.hpp | 16 - src/mbgl/shaders/circle.cpp | 294 ------- src/mbgl/shaders/circle.hpp | 16 - src/mbgl/shaders/clipping_mask.cpp | 34 - src/mbgl/shaders/clipping_mask.hpp | 16 - src/mbgl/shaders/collision_box.cpp | 71 -- src/mbgl/shaders/collision_box.hpp | 16 - src/mbgl/shaders/collision_circle.cpp | 94 --- src/mbgl/shaders/collision_circle.hpp | 16 - src/mbgl/shaders/debug.cpp | 36 - src/mbgl/shaders/debug.hpp | 16 - src/mbgl/shaders/extrusion_texture.cpp | 46 -- src/mbgl/shaders/extrusion_texture.hpp | 16 - src/mbgl/shaders/fill.cpp | 98 --- src/mbgl/shaders/fill.hpp | 16 - src/mbgl/shaders/fill_extrusion.cpp | 136 --- src/mbgl/shaders/fill_extrusion.hpp | 16 - src/mbgl/shaders/fill_extrusion_pattern.cpp | 235 ------ src/mbgl/shaders/fill_extrusion_pattern.hpp | 16 - src/mbgl/shaders/fill_outline.cpp | 106 --- src/mbgl/shaders/fill_outline.hpp | 16 - src/mbgl/shaders/fill_outline_pattern.cpp | 180 ---- src/mbgl/shaders/fill_outline_pattern.hpp | 16 - src/mbgl/shaders/fill_pattern.cpp | 168 ---- src/mbgl/shaders/fill_pattern.hpp | 16 - src/mbgl/shaders/heatmap.cpp | 135 --- src/mbgl/shaders/heatmap.hpp | 16 - src/mbgl/shaders/heatmap_texture.cpp | 49 -- src/mbgl/shaders/heatmap_texture.hpp | 16 - src/mbgl/shaders/hillshade.cpp | 87 -- src/mbgl/shaders/hillshade.hpp | 16 - src/mbgl/shaders/hillshade_prepare.cpp | 111 --- src/mbgl/shaders/hillshade_prepare.hpp | 16 - src/mbgl/shaders/line.cpp | 247 ------ src/mbgl/shaders/line.hpp | 16 - src/mbgl/shaders/line_gradient.cpp | 229 ----- src/mbgl/shaders/line_gradient.hpp | 16 - src/mbgl/shaders/line_pattern.cpp | 316 ------- src/mbgl/shaders/line_pattern.hpp | 16 - src/mbgl/shaders/line_sdf.cpp | 309 ------- src/mbgl/shaders/line_sdf.hpp | 16 - src/mbgl/shaders/preludes.cpp | 13 - src/mbgl/shaders/preludes.hpp | 12 - src/mbgl/shaders/raster.cpp | 97 --- src/mbgl/shaders/raster.hpp | 16 - src/mbgl/shaders/shaders.cpp | 29 - src/mbgl/shaders/shaders.hpp | 16 - src/mbgl/shaders/source.cpp | 917 --------------------- src/mbgl/shaders/source.hpp | 11 - src/mbgl/shaders/symbol_icon.cpp | 156 ---- src/mbgl/shaders/symbol_icon.hpp | 16 - src/mbgl/shaders/symbol_sdf.cpp | 311 ------- src/mbgl/shaders/symbol_sdf.hpp | 16 - 154 files changed, 5052 insertions(+), 5284 deletions(-) create mode 100644 src/mbgl/gfx/context_impl.hpp create mode 100644 src/mbgl/programs/background_pattern_program.hpp create mode 100644 src/mbgl/programs/clipping_mask_program.cpp create mode 100644 src/mbgl/programs/collision_circle_program.hpp create mode 100644 src/mbgl/programs/debug_program.cpp create mode 100644 src/mbgl/programs/fill_extrusion_pattern_program.hpp create mode 100644 src/mbgl/programs/fill_outline_pattern_program.hpp create mode 100644 src/mbgl/programs/fill_outline_program.hpp create mode 100644 src/mbgl/programs/fill_pattern_program.hpp create mode 100644 src/mbgl/programs/gl/background.cpp create mode 100644 src/mbgl/programs/gl/background_pattern.cpp create mode 100644 src/mbgl/programs/gl/circle.cpp create mode 100644 src/mbgl/programs/gl/clipping_mask.cpp create mode 100644 src/mbgl/programs/gl/collision_box.cpp create mode 100644 src/mbgl/programs/gl/collision_circle.cpp create mode 100644 src/mbgl/programs/gl/debug.cpp create mode 100644 src/mbgl/programs/gl/extrusion_texture.cpp create mode 100644 src/mbgl/programs/gl/fill.cpp create mode 100644 src/mbgl/programs/gl/fill_extrusion.cpp create mode 100644 src/mbgl/programs/gl/fill_extrusion_pattern.cpp create mode 100644 src/mbgl/programs/gl/fill_outline.cpp create mode 100644 src/mbgl/programs/gl/fill_outline_pattern.cpp create mode 100644 src/mbgl/programs/gl/fill_pattern.cpp create mode 100644 src/mbgl/programs/gl/heatmap.cpp create mode 100644 src/mbgl/programs/gl/heatmap_texture.cpp create mode 100644 src/mbgl/programs/gl/hillshade.cpp create mode 100644 src/mbgl/programs/gl/hillshade_prepare.cpp create mode 100644 src/mbgl/programs/gl/line.cpp create mode 100644 src/mbgl/programs/gl/line_gradient.cpp create mode 100644 src/mbgl/programs/gl/line_pattern.cpp create mode 100644 src/mbgl/programs/gl/line_sdf.cpp create mode 100644 src/mbgl/programs/gl/preludes.cpp create mode 100644 src/mbgl/programs/gl/preludes.hpp create mode 100644 src/mbgl/programs/gl/raster.cpp create mode 100644 src/mbgl/programs/gl/shader_source.cpp create mode 100644 src/mbgl/programs/gl/shader_source.hpp create mode 100644 src/mbgl/programs/gl/shaders.cpp create mode 100644 src/mbgl/programs/gl/shaders.hpp create mode 100644 src/mbgl/programs/gl/symbol_icon.cpp create mode 100644 src/mbgl/programs/gl/symbol_sdf_icon.cpp create mode 100644 src/mbgl/programs/gl/symbol_sdf_text.cpp create mode 100644 src/mbgl/programs/line_gradient_program.hpp create mode 100644 src/mbgl/programs/line_pattern_program.hpp create mode 100644 src/mbgl/programs/line_sdf_program.hpp create mode 100644 src/mbgl/programs/symbol_icon_program.hpp create mode 100644 src/mbgl/programs/symbol_sdf_icon_program.hpp create mode 100644 src/mbgl/programs/symbol_sdf_text_program.hpp delete mode 100644 src/mbgl/shaders/background.cpp delete mode 100644 src/mbgl/shaders/background.hpp delete mode 100644 src/mbgl/shaders/background_pattern.cpp delete mode 100644 src/mbgl/shaders/background_pattern.hpp delete mode 100644 src/mbgl/shaders/circle.cpp delete mode 100644 src/mbgl/shaders/circle.hpp delete mode 100644 src/mbgl/shaders/clipping_mask.cpp delete mode 100644 src/mbgl/shaders/clipping_mask.hpp delete mode 100644 src/mbgl/shaders/collision_box.cpp delete mode 100644 src/mbgl/shaders/collision_box.hpp delete mode 100644 src/mbgl/shaders/collision_circle.cpp delete mode 100644 src/mbgl/shaders/collision_circle.hpp delete mode 100644 src/mbgl/shaders/debug.cpp delete mode 100644 src/mbgl/shaders/debug.hpp delete mode 100644 src/mbgl/shaders/extrusion_texture.cpp delete mode 100644 src/mbgl/shaders/extrusion_texture.hpp delete mode 100644 src/mbgl/shaders/fill.cpp delete mode 100644 src/mbgl/shaders/fill.hpp delete mode 100644 src/mbgl/shaders/fill_extrusion.cpp delete mode 100644 src/mbgl/shaders/fill_extrusion.hpp delete mode 100644 src/mbgl/shaders/fill_extrusion_pattern.cpp delete mode 100644 src/mbgl/shaders/fill_extrusion_pattern.hpp delete mode 100644 src/mbgl/shaders/fill_outline.cpp delete mode 100644 src/mbgl/shaders/fill_outline.hpp delete mode 100644 src/mbgl/shaders/fill_outline_pattern.cpp delete mode 100644 src/mbgl/shaders/fill_outline_pattern.hpp delete mode 100644 src/mbgl/shaders/fill_pattern.cpp delete mode 100644 src/mbgl/shaders/fill_pattern.hpp delete mode 100644 src/mbgl/shaders/heatmap.cpp delete mode 100644 src/mbgl/shaders/heatmap.hpp delete mode 100644 src/mbgl/shaders/heatmap_texture.cpp delete mode 100644 src/mbgl/shaders/heatmap_texture.hpp delete mode 100644 src/mbgl/shaders/hillshade.cpp delete mode 100644 src/mbgl/shaders/hillshade.hpp delete mode 100644 src/mbgl/shaders/hillshade_prepare.cpp delete mode 100644 src/mbgl/shaders/hillshade_prepare.hpp delete mode 100644 src/mbgl/shaders/line.cpp delete mode 100644 src/mbgl/shaders/line.hpp delete mode 100644 src/mbgl/shaders/line_gradient.cpp delete mode 100644 src/mbgl/shaders/line_gradient.hpp delete mode 100644 src/mbgl/shaders/line_pattern.cpp delete mode 100644 src/mbgl/shaders/line_pattern.hpp delete mode 100644 src/mbgl/shaders/line_sdf.cpp delete mode 100644 src/mbgl/shaders/line_sdf.hpp delete mode 100644 src/mbgl/shaders/preludes.cpp delete mode 100644 src/mbgl/shaders/preludes.hpp delete mode 100644 src/mbgl/shaders/raster.cpp delete mode 100644 src/mbgl/shaders/raster.hpp delete mode 100644 src/mbgl/shaders/shaders.cpp delete mode 100644 src/mbgl/shaders/shaders.hpp delete mode 100644 src/mbgl/shaders/source.cpp delete mode 100644 src/mbgl/shaders/source.hpp delete mode 100644 src/mbgl/shaders/symbol_icon.cpp delete mode 100644 src/mbgl/shaders/symbol_icon.hpp delete mode 100644 src/mbgl/shaders/symbol_sdf.cpp delete mode 100644 src/mbgl/shaders/symbol_sdf.hpp diff --git a/scripts/generate-shaders.js b/scripts/generate-shaders.js index 78d8911839..59544d0b34 100755 --- a/scripts/generate-shaders.js +++ b/scripts/generate-shaders.js @@ -3,7 +3,7 @@ require('flow-remove-types/register'); const path = require('path'); -const outputPath = 'src/mbgl/shaders'; +const outputPath = 'src/mbgl/programs/gl'; const zlib = require('zlib'); var shaders = require('../mapbox-gl-js/src/shaders'); @@ -31,52 +31,82 @@ for (const key in shaders) { concatenated += basicMinify(shaders[key].fragmentSource); concatenated += '\n\0'; - offsets[key] = {vertex, fragment}; + offsets[key] = { + vertex, + fragment, + originalKey: key, + shaderName: key.replace(/[A-Z]+/g, (match) => `_${match.toLowerCase()}`), + ShaderName: key.replace(/^[a-z]/g, (match) => match.toUpperCase()) + }; } +// Overrides: The symbolSDF shader is used for two underlying programs. +offsets.symbolSDFIcon = { + vertex: offsets.symbolSDF.vertex, + fragment: offsets.symbolSDF.fragment, + originalKey: 'symbolSDF', + shaderName: 'symbol_sdf_icon', + ShaderName: 'SymbolSDFIcon', +}; + +offsets.symbolSDFText = { + vertex: offsets.symbolSDF.vertex, + fragment: offsets.symbolSDF.fragment, + originalKey: 'symbolSDF', + shaderName: 'symbol_sdf_text', + ShaderName: 'SymbolSDFText', +}; + +delete offsets.symbolSDF; + const compressed = zlib.deflateSync(concatenated, {level: zlib.Z_BEST_COMPRESSION}) .toString('hex') - .match(/.{1,16}/g) + .match(/.{1,32}/g) .map(line => line.match(/.{1,2}/g).map(n => `0x${n}`).join(', ')) - .join(',\n ') + .join(',\n ') .trim(); function sourceOffset(key, type) { - return `source() + ${offsets[key][type]}` + return `programs::gl::shaderSource() + ${offsets[key][type]}` } -writeIfModified(path.join(outputPath, 'source.hpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. +writeIfModified(path.join(outputPath, 'shader_source.hpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. #pragma once namespace mbgl { -namespace shaders { +namespace programs { +namespace gl { -const char* source(); +const char* shaderSource(); -} // namespace shaders +} // namespace gl +} // namespace programs } // namespace mbgl `); -writeIfModified(path.join(outputPath, 'source.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. +writeIfModified(path.join(outputPath, 'shader_source.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. -#include +#include #include #include namespace mbgl { -namespace shaders { +namespace programs { +namespace gl { -const char* source() { - static const uint8_t compressed[] = { - ${compressed} - }; - static std::string decompressed = util::decompress(std::string(reinterpret_cast(compressed), sizeof(compressed))); +constexpr const uint8_t compressedShaderSource[] = { + ${compressed} +}; + +const char* shaderSource() { + static std::string decompressed = util::decompress(std::string(reinterpret_cast(compressedShaderSource), sizeof(compressedShaderSource))); return decompressed.c_str(); }; -} // namespace shaders +} // namespace gl +} // namespace programs } // namespace mbgl `); @@ -85,77 +115,69 @@ writeIfModified(path.join(outputPath, 'preludes.hpp'), `// NOTE: DO NOT CHANGE T #pragma once namespace mbgl { -namespace shaders { +namespace programs { +namespace gl { -extern const char* vertexPrelude; -extern const char* fragmentPrelude; +extern const char* vertexShaderPrelude; +extern const char* fragmentShaderPrelude; -} // namespace shaders +} // namespace gl +} // namespace programs } // namespace mbgl `); writeIfModified(path.join(outputPath, 'preludes.cpp'), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. -#include -#include +#include +#include namespace mbgl { -namespace shaders { +namespace programs { +namespace gl { -const char* vertexPrelude = ${sourceOffset('prelude', 'vertex')}; -const char* fragmentPrelude = ${sourceOffset('prelude', 'fragment')}; +const char* vertexShaderPrelude = ${sourceOffset('prelude', 'vertex')}; +const char* fragmentShaderPrelude = ${sourceOffset('prelude', 'fragment')}; -} // namespace shaders +} // namespace gl +} // namespace programs } // namespace mbgl `); -for (const key in shaders) { +for (const key in offsets) { if (key === 'prelude') continue; - const shaderName = key.replace(/[A-Z]+/g, (match) => `_${match.toLowerCase()}`); - - writeIfModified(path.join(outputPath, `${shaderName}.hpp`), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class ${shaderName} { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl -`); + const { shaderName, ShaderName, originalKey } = offsets[key]; writeIfModified(path.join(outputPath, `${shaderName}.cpp`), `// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. -#include -#include +#include +#include +#include namespace mbgl { -namespace shaders { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program<${ShaderName}Program>::createProgram( + reinterpret_cast(*this), programParameters, "${shaderName}", + ${sourceOffset(key, 'vertex')}, ${sourceOffset(key, 'fragment')}); +} -const char* ${shaderName}::name = "${shaderName}"; -const char* ${shaderName}::vertexSource = ${sourceOffset(key, 'vertex')}; -const char* ${shaderName}::fragmentSource = ${sourceOffset(key, 'fragment')}; +} // namespace gfx +} // namespace mbgl // Uncompressed source of ${shaderName}.vertex.glsl: /* -${shaders[key].vertexSource} +${shaders[originalKey].vertexSource} */ // Uncompressed source of ${shaderName}.fragment.glsl: /* -${shaders[key].fragmentSource} +${shaders[originalKey].fragmentSource} */ -} // namespace shaders -} // namespace mbgl `); } diff --git a/src/core-files.json b/src/core-files.json index 4c2e4b07a7..272faaf9b6 100644 --- a/src/core-files.json +++ b/src/core-files.json @@ -54,10 +54,41 @@ "src/mbgl/platform/gl_functions.cpp", "src/mbgl/programs/background_program.cpp", "src/mbgl/programs/circle_program.cpp", + "src/mbgl/programs/clipping_mask_program.cpp", "src/mbgl/programs/collision_box_program.cpp", + "src/mbgl/programs/debug_program.cpp", "src/mbgl/programs/extrusion_texture_program.cpp", "src/mbgl/programs/fill_extrusion_program.cpp", "src/mbgl/programs/fill_program.cpp", + "src/mbgl/programs/gl/background.cpp", + "src/mbgl/programs/gl/background_pattern.cpp", + "src/mbgl/programs/gl/circle.cpp", + "src/mbgl/programs/gl/clipping_mask.cpp", + "src/mbgl/programs/gl/collision_box.cpp", + "src/mbgl/programs/gl/collision_circle.cpp", + "src/mbgl/programs/gl/debug.cpp", + "src/mbgl/programs/gl/extrusion_texture.cpp", + "src/mbgl/programs/gl/fill.cpp", + "src/mbgl/programs/gl/fill_extrusion.cpp", + "src/mbgl/programs/gl/fill_extrusion_pattern.cpp", + "src/mbgl/programs/gl/fill_outline.cpp", + "src/mbgl/programs/gl/fill_outline_pattern.cpp", + "src/mbgl/programs/gl/fill_pattern.cpp", + "src/mbgl/programs/gl/heatmap.cpp", + "src/mbgl/programs/gl/heatmap_texture.cpp", + "src/mbgl/programs/gl/hillshade.cpp", + "src/mbgl/programs/gl/hillshade_prepare.cpp", + "src/mbgl/programs/gl/line.cpp", + "src/mbgl/programs/gl/line_gradient.cpp", + "src/mbgl/programs/gl/line_pattern.cpp", + "src/mbgl/programs/gl/line_sdf.cpp", + "src/mbgl/programs/gl/preludes.cpp", + "src/mbgl/programs/gl/raster.cpp", + "src/mbgl/programs/gl/shader_source.cpp", + "src/mbgl/programs/gl/shaders.cpp", + "src/mbgl/programs/gl/symbol_icon.cpp", + "src/mbgl/programs/gl/symbol_sdf_icon.cpp", + "src/mbgl/programs/gl/symbol_sdf_text.cpp", "src/mbgl/programs/heatmap_program.cpp", "src/mbgl/programs/heatmap_texture_program.cpp", "src/mbgl/programs/hillshade_prepare_program.cpp", @@ -110,34 +141,6 @@ "src/mbgl/renderer/sources/render_vector_source.cpp", "src/mbgl/renderer/style_diff.cpp", "src/mbgl/renderer/tile_pyramid.cpp", - "src/mbgl/shaders/background.cpp", - "src/mbgl/shaders/background_pattern.cpp", - "src/mbgl/shaders/circle.cpp", - "src/mbgl/shaders/clipping_mask.cpp", - "src/mbgl/shaders/collision_box.cpp", - "src/mbgl/shaders/collision_circle.cpp", - "src/mbgl/shaders/debug.cpp", - "src/mbgl/shaders/extrusion_texture.cpp", - "src/mbgl/shaders/fill.cpp", - "src/mbgl/shaders/fill_extrusion.cpp", - "src/mbgl/shaders/fill_extrusion_pattern.cpp", - "src/mbgl/shaders/fill_outline.cpp", - "src/mbgl/shaders/fill_outline_pattern.cpp", - "src/mbgl/shaders/fill_pattern.cpp", - "src/mbgl/shaders/heatmap.cpp", - "src/mbgl/shaders/heatmap_texture.cpp", - "src/mbgl/shaders/hillshade.cpp", - "src/mbgl/shaders/hillshade_prepare.cpp", - "src/mbgl/shaders/line.cpp", - "src/mbgl/shaders/line_gradient.cpp", - "src/mbgl/shaders/line_pattern.cpp", - "src/mbgl/shaders/line_sdf.cpp", - "src/mbgl/shaders/preludes.cpp", - "src/mbgl/shaders/raster.cpp", - "src/mbgl/shaders/shaders.cpp", - "src/mbgl/shaders/source.cpp", - "src/mbgl/shaders/symbol_icon.cpp", - "src/mbgl/shaders/symbol_sdf.cpp", "src/mbgl/sprite/sprite_loader.cpp", "src/mbgl/sprite/sprite_loader_worker.cpp", "src/mbgl/sprite/sprite_parser.cpp", @@ -506,12 +509,14 @@ "mbgl/gfx/attribute.hpp": "src/mbgl/gfx/attribute.hpp", "mbgl/gfx/color_mode.hpp": "src/mbgl/gfx/color_mode.hpp", "mbgl/gfx/context.hpp": "src/mbgl/gfx/context.hpp", + "mbgl/gfx/context_impl.hpp": "src/mbgl/gfx/context_impl.hpp", "mbgl/gfx/cull_face_mode.hpp": "src/mbgl/gfx/cull_face_mode.hpp", "mbgl/gfx/depth_mode.hpp": "src/mbgl/gfx/depth_mode.hpp", "mbgl/gfx/draw_mode.hpp": "src/mbgl/gfx/draw_mode.hpp", "mbgl/gfx/draw_scope.hpp": "src/mbgl/gfx/draw_scope.hpp", "mbgl/gfx/index_buffer.hpp": "src/mbgl/gfx/index_buffer.hpp", "mbgl/gfx/index_vector.hpp": "src/mbgl/gfx/index_vector.hpp", + "mbgl/gfx/program.hpp": "src/mbgl/gfx/program.hpp", "mbgl/gfx/stencil_mode.hpp": "src/mbgl/gfx/stencil_mode.hpp", "mbgl/gfx/texture.hpp": "src/mbgl/gfx/texture.hpp", "mbgl/gfx/types.hpp": "src/mbgl/gfx/types.hpp", @@ -556,25 +561,40 @@ "mbgl/map/transform_state.hpp": "src/mbgl/map/transform_state.hpp", "mbgl/map/zoom_history.hpp": "src/mbgl/map/zoom_history.hpp", "mbgl/programs/attributes.hpp": "src/mbgl/programs/attributes.hpp", + "mbgl/programs/background_pattern_program.hpp": "src/mbgl/programs/background_pattern_program.hpp", "mbgl/programs/background_program.hpp": "src/mbgl/programs/background_program.hpp", "mbgl/programs/circle_program.hpp": "src/mbgl/programs/circle_program.hpp", "mbgl/programs/clipping_mask_program.hpp": "src/mbgl/programs/clipping_mask_program.hpp", "mbgl/programs/collision_box_program.hpp": "src/mbgl/programs/collision_box_program.hpp", + "mbgl/programs/collision_circle_program.hpp": "src/mbgl/programs/collision_circle_program.hpp", "mbgl/programs/debug_program.hpp": "src/mbgl/programs/debug_program.hpp", "mbgl/programs/extrusion_texture_program.hpp": "src/mbgl/programs/extrusion_texture_program.hpp", + "mbgl/programs/fill_extrusion_pattern_program.hpp": "src/mbgl/programs/fill_extrusion_pattern_program.hpp", "mbgl/programs/fill_extrusion_program.hpp": "src/mbgl/programs/fill_extrusion_program.hpp", + "mbgl/programs/fill_outline_pattern_program.hpp": "src/mbgl/programs/fill_outline_pattern_program.hpp", + "mbgl/programs/fill_outline_program.hpp": "src/mbgl/programs/fill_outline_program.hpp", + "mbgl/programs/fill_pattern_program.hpp": "src/mbgl/programs/fill_pattern_program.hpp", "mbgl/programs/fill_program.hpp": "src/mbgl/programs/fill_program.hpp", + "mbgl/programs/gl/preludes.hpp": "src/mbgl/programs/gl/preludes.hpp", + "mbgl/programs/gl/shader_source.hpp": "src/mbgl/programs/gl/shader_source.hpp", + "mbgl/programs/gl/shaders.hpp": "src/mbgl/programs/gl/shaders.hpp", "mbgl/programs/heatmap_program.hpp": "src/mbgl/programs/heatmap_program.hpp", "mbgl/programs/heatmap_texture_program.hpp": "src/mbgl/programs/heatmap_texture_program.hpp", "mbgl/programs/hillshade_prepare_program.hpp": "src/mbgl/programs/hillshade_prepare_program.hpp", "mbgl/programs/hillshade_program.hpp": "src/mbgl/programs/hillshade_program.hpp", + "mbgl/programs/line_gradient_program.hpp": "src/mbgl/programs/line_gradient_program.hpp", + "mbgl/programs/line_pattern_program.hpp": "src/mbgl/programs/line_pattern_program.hpp", "mbgl/programs/line_program.hpp": "src/mbgl/programs/line_program.hpp", + "mbgl/programs/line_sdf_program.hpp": "src/mbgl/programs/line_sdf_program.hpp", "mbgl/programs/program.hpp": "src/mbgl/programs/program.hpp", "mbgl/programs/program_parameters.hpp": "src/mbgl/programs/program_parameters.hpp", "mbgl/programs/programs.hpp": "src/mbgl/programs/programs.hpp", "mbgl/programs/raster_program.hpp": "src/mbgl/programs/raster_program.hpp", "mbgl/programs/segment.hpp": "src/mbgl/programs/segment.hpp", + "mbgl/programs/symbol_icon_program.hpp": "src/mbgl/programs/symbol_icon_program.hpp", "mbgl/programs/symbol_program.hpp": "src/mbgl/programs/symbol_program.hpp", + "mbgl/programs/symbol_sdf_icon_program.hpp": "src/mbgl/programs/symbol_sdf_icon_program.hpp", + "mbgl/programs/symbol_sdf_text_program.hpp": "src/mbgl/programs/symbol_sdf_text_program.hpp", "mbgl/programs/textures.hpp": "src/mbgl/programs/textures.hpp", "mbgl/programs/uniforms.hpp": "src/mbgl/programs/uniforms.hpp", "mbgl/renderer/bucket.hpp": "src/mbgl/renderer/bucket.hpp", @@ -630,34 +650,6 @@ "mbgl/renderer/tile_pyramid.hpp": "src/mbgl/renderer/tile_pyramid.hpp", "mbgl/renderer/transition_parameters.hpp": "src/mbgl/renderer/transition_parameters.hpp", "mbgl/renderer/update_parameters.hpp": "src/mbgl/renderer/update_parameters.hpp", - "mbgl/shaders/background.hpp": "src/mbgl/shaders/background.hpp", - "mbgl/shaders/background_pattern.hpp": "src/mbgl/shaders/background_pattern.hpp", - "mbgl/shaders/circle.hpp": "src/mbgl/shaders/circle.hpp", - "mbgl/shaders/clipping_mask.hpp": "src/mbgl/shaders/clipping_mask.hpp", - "mbgl/shaders/collision_box.hpp": "src/mbgl/shaders/collision_box.hpp", - "mbgl/shaders/collision_circle.hpp": "src/mbgl/shaders/collision_circle.hpp", - "mbgl/shaders/debug.hpp": "src/mbgl/shaders/debug.hpp", - "mbgl/shaders/extrusion_texture.hpp": "src/mbgl/shaders/extrusion_texture.hpp", - "mbgl/shaders/fill.hpp": "src/mbgl/shaders/fill.hpp", - "mbgl/shaders/fill_extrusion.hpp": "src/mbgl/shaders/fill_extrusion.hpp", - "mbgl/shaders/fill_extrusion_pattern.hpp": "src/mbgl/shaders/fill_extrusion_pattern.hpp", - "mbgl/shaders/fill_outline.hpp": "src/mbgl/shaders/fill_outline.hpp", - "mbgl/shaders/fill_outline_pattern.hpp": "src/mbgl/shaders/fill_outline_pattern.hpp", - "mbgl/shaders/fill_pattern.hpp": "src/mbgl/shaders/fill_pattern.hpp", - "mbgl/shaders/heatmap.hpp": "src/mbgl/shaders/heatmap.hpp", - "mbgl/shaders/heatmap_texture.hpp": "src/mbgl/shaders/heatmap_texture.hpp", - "mbgl/shaders/hillshade.hpp": "src/mbgl/shaders/hillshade.hpp", - "mbgl/shaders/hillshade_prepare.hpp": "src/mbgl/shaders/hillshade_prepare.hpp", - "mbgl/shaders/line.hpp": "src/mbgl/shaders/line.hpp", - "mbgl/shaders/line_gradient.hpp": "src/mbgl/shaders/line_gradient.hpp", - "mbgl/shaders/line_pattern.hpp": "src/mbgl/shaders/line_pattern.hpp", - "mbgl/shaders/line_sdf.hpp": "src/mbgl/shaders/line_sdf.hpp", - "mbgl/shaders/preludes.hpp": "src/mbgl/shaders/preludes.hpp", - "mbgl/shaders/raster.hpp": "src/mbgl/shaders/raster.hpp", - "mbgl/shaders/shaders.hpp": "src/mbgl/shaders/shaders.hpp", - "mbgl/shaders/source.hpp": "src/mbgl/shaders/source.hpp", - "mbgl/shaders/symbol_icon.hpp": "src/mbgl/shaders/symbol_icon.hpp", - "mbgl/shaders/symbol_sdf.hpp": "src/mbgl/shaders/symbol_sdf.hpp", "mbgl/sprite/sprite_loader.hpp": "src/mbgl/sprite/sprite_loader.hpp", "mbgl/sprite/sprite_loader_observer.hpp": "src/mbgl/sprite/sprite_loader_observer.hpp", "mbgl/sprite/sprite_loader_worker.hpp": "src/mbgl/sprite/sprite_loader_worker.hpp", diff --git a/src/mbgl/gfx/context.hpp b/src/mbgl/gfx/context.hpp index f98b2266f4..90b62c94a4 100644 --- a/src/mbgl/gfx/context.hpp +++ b/src/mbgl/gfx/context.hpp @@ -6,14 +6,21 @@ #include #include #include +#include #include namespace mbgl { + +class ProgramParameters; + namespace gfx { class Context { protected: - Context() = default; + Context(ContextType type_) : backend(type_) { + } + + const ContextType backend; public: Context(Context&&) = delete; @@ -98,6 +105,14 @@ public: protected: virtual std::unique_ptr createDrawScopeResource() = 0; + +public: + template + std::unique_ptr> createProgram(const ProgramParameters&); + +private: + template + std::unique_ptr> createProgram(const ProgramParameters&); }; } // namespace gfx diff --git a/src/mbgl/gfx/context_impl.hpp b/src/mbgl/gfx/context_impl.hpp new file mode 100644 index 0000000000..0145535bb3 --- /dev/null +++ b/src/mbgl/gfx/context_impl.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include + +namespace mbgl { + +namespace gl { +class Context; +} // namespace gl + +namespace gfx { + +template +std::unique_ptr> Context::createProgram(const ProgramParameters& programParameters) { + if (backend == ContextType::OpenGL) { + return createProgram(programParameters); + } + assert(false); + return nullptr; +} + +} // namespace gfx +} // namespace mbgl diff --git a/src/mbgl/gfx/program.hpp b/src/mbgl/gfx/program.hpp index b72aea4b30..94ba3b18ef 100644 --- a/src/mbgl/gfx/program.hpp +++ b/src/mbgl/gfx/program.hpp @@ -17,7 +17,7 @@ template class UniformValues; template class AttributeBindings; template class TextureBindings; -template +template class Program { protected: Program() = default; @@ -30,6 +30,10 @@ public: Program& operator=(Program&&) = delete; Program& operator=(const Program&) = delete; + using AttributeList = typename Name::AttributeList; + using UniformList = typename Name::UniformList; + using TextureList = typename Name::TextureList; + virtual void draw(Context&, const DrawMode&, const DepthMode&, diff --git a/src/mbgl/gfx/types.hpp b/src/mbgl/gfx/types.hpp index 42647eb9a8..da2bc14ddd 100644 --- a/src/mbgl/gfx/types.hpp +++ b/src/mbgl/gfx/types.hpp @@ -5,6 +5,10 @@ namespace mbgl { namespace gfx { +enum class ContextType : uint8_t { + OpenGL, +}; + enum class PrimitiveType : uint8_t { Point, Line, diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 4195bb98c5..5193381251 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -67,7 +67,7 @@ static_assert(underlying_type(UniformDataType::SamplerCube) == GL_SAMPLER_CUBE, static_assert(std::is_same::value, "OpenGL type mismatch"); Context::Context() - : maximumVertexBindingCount([] { + : gfx::Context(gfx::ContextType::OpenGL), maximumVertexBindingCount([] { GLint value; MBGL_CHECK_ERROR(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value)); return value; diff --git a/src/mbgl/gl/program.hpp b/src/mbgl/gl/program.hpp index 921362e4f3..9028ffdf53 100644 --- a/src/mbgl/gl/program.hpp +++ b/src/mbgl/gl/program.hpp @@ -18,16 +18,20 @@ #include #include -#include +#include #include namespace mbgl { namespace gl { -template -class Program final : public gfx::Program { +template +class Program final : public gfx::Program { public: + using AttributeList = typename Name::AttributeList; + using UniformList = typename Name::UniformList; + using TextureList = typename Name::TextureList; + Program(Context& context, const std::string& vertexSource, const std::string& fragmentSource) : program( context.createProgram(context.createShader(ShaderType::Vertex, vertexSource), @@ -57,13 +61,13 @@ public: const char* name, const char* vertexSource_, const char* fragmentSource_) { - const std::string vertexSource = shaders::vertexSource(programParameters, vertexSource_); - const std::string fragmentSource = shaders::fragmentSource(programParameters, fragmentSource_); + const std::string vertexSource = programs::gl::vertexSource(programParameters, vertexSource_); + const std::string fragmentSource = programs::gl::fragmentSource(programParameters, fragmentSource_); #if MBGL_HAS_BINARY_PROGRAMS optional cachePath = programParameters.cachePath(name); if (cachePath && context.supportsProgramBinaries()) { - const std::string identifier = shaders::programIdentifier(vertexSource, fragmentSource); + const std::string identifier = programs::gl::programIdentifier(vertexSource, fragmentSource); try { if (auto cachedBinaryProgram = util::readFile(*cachePath)) { diff --git a/src/mbgl/programs/background_pattern_program.hpp b/src/mbgl/programs/background_pattern_program.hpp new file mode 100644 index 0000000000..4b66065670 --- /dev/null +++ b/src/mbgl/programs/background_pattern_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/background_program.cpp b/src/mbgl/programs/background_program.cpp index ce4715f4b9..7d68f62fb1 100644 --- a/src/mbgl/programs/background_program.cpp +++ b/src/mbgl/programs/background_program.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -6,6 +7,9 @@ namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + using namespace style; static_assert(sizeof(BackgroundLayoutVertex) == 4, "expected BackgroundLayoutVertex size"); diff --git a/src/mbgl/programs/background_program.hpp b/src/mbgl/programs/background_program.hpp index a8bcd9dc3c..b1ade6dc84 100644 --- a/src/mbgl/programs/background_program.hpp +++ b/src/mbgl/programs/background_program.hpp @@ -4,14 +4,9 @@ #include #include #include -#include -#include #include #include #include -#include - -#include namespace mbgl { @@ -46,7 +41,6 @@ using BackgroundPatternUniforms = TypeList< class BackgroundProgram : public Program< BackgroundProgram, - shaders::background, gfx::PrimitiveType::Triangle, BackgroundLayoutAttributes, BackgroundUniforms, @@ -59,7 +53,6 @@ public: class BackgroundPatternProgram : public Program< BackgroundPatternProgram, - shaders::background_pattern, gfx::PrimitiveType::Triangle, BackgroundLayoutAttributes, BackgroundPatternUniforms, @@ -85,7 +78,7 @@ using BackgroundAttributes = BackgroundProgram::AttributeList; class BackgroundLayerPrograms final : public LayerTypePrograms { public: - BackgroundLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + BackgroundLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : background(context, programParameters), backgroundPattern(context, programParameters) {} BackgroundProgram background; diff --git a/src/mbgl/programs/circle_program.cpp b/src/mbgl/programs/circle_program.cpp index 99b47dd5c0..577410d94e 100644 --- a/src/mbgl/programs/circle_program.cpp +++ b/src/mbgl/programs/circle_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(CircleLayoutVertex) == 4, "expected CircleLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/circle_program.hpp b/src/mbgl/programs/circle_program.hpp index 136a6f89cf..0caa1b2a15 100644 --- a/src/mbgl/programs/circle_program.hpp +++ b/src/mbgl/programs/circle_program.hpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -15,7 +14,6 @@ MBGL_DEFINE_UNIFORM_SCALAR(bool, u_scale_with_map); class CircleProgram : public Program< CircleProgram, - shaders::circle, gfx::PrimitiveType::Triangle, TypeList< attributes::a_pos>, @@ -52,7 +50,7 @@ using CircleAttributes = CircleProgram::AttributeList; class CircleLayerPrograms final : public LayerTypePrograms { public: - CircleLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + CircleLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : circle(context, programParameters) {} ProgramMap circle; }; diff --git a/src/mbgl/programs/clipping_mask_program.cpp b/src/mbgl/programs/clipping_mask_program.cpp new file mode 100644 index 0000000000..9b1a9ef4fc --- /dev/null +++ b/src/mbgl/programs/clipping_mask_program.cpp @@ -0,0 +1,8 @@ +#include +#include + +namespace mbgl { + +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + +} // namespace mbgl diff --git a/src/mbgl/programs/clipping_mask_program.hpp b/src/mbgl/programs/clipping_mask_program.hpp index 687b76fcb9..874708a52f 100644 --- a/src/mbgl/programs/clipping_mask_program.hpp +++ b/src/mbgl/programs/clipping_mask_program.hpp @@ -3,14 +3,12 @@ #include #include #include -#include #include namespace mbgl { class ClippingMaskProgram : public Program< ClippingMaskProgram, - shaders::clipping_mask, gfx::PrimitiveType::Triangle, PositionOnlyLayoutAttributes, TypeList< diff --git a/src/mbgl/programs/collision_box_program.cpp b/src/mbgl/programs/collision_box_program.cpp index 584013640e..885894526e 100644 --- a/src/mbgl/programs/collision_box_program.cpp +++ b/src/mbgl/programs/collision_box_program.cpp @@ -1,7 +1,11 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(CollisionBoxProgram::LayoutVertex) == 24, "expected CollisionBoxVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/collision_box_program.hpp b/src/mbgl/programs/collision_box_program.hpp index 2434324299..7b81752a94 100644 --- a/src/mbgl/programs/collision_box_program.hpp +++ b/src/mbgl/programs/collision_box_program.hpp @@ -3,8 +3,6 @@ #include #include #include -#include -#include #include #include @@ -22,7 +20,6 @@ using CollisionBoxDynamicAttributes = TypeList; class CollisionBoxProgram : public Program< CollisionBoxProgram, - shaders::collision_box, gfx::PrimitiveType::Line, TypeListConcat, TypeList< @@ -64,11 +61,11 @@ public: template void draw(gfx::Context& context, - DrawMode drawMode, - gfx::DepthMode depthMode, - gfx::StencilMode stencilMode, - gfx::ColorMode colorMode, - gfx::CullFaceMode cullFaceMode, + const DrawMode& drawMode, + const gfx::DepthMode& depthMode, + const gfx::StencilMode& stencilMode, + const gfx::ColorMode& colorMode, + const gfx::CullFaceMode& cullFaceMode, const LayoutUniformValues& layoutUniformValues, const gfx::VertexBuffer>& layoutVertexBuffer, const gfx::VertexBuffer>& dynamicVertexBuffer, @@ -116,7 +113,6 @@ public: class CollisionCircleProgram : public Program< CollisionCircleProgram, - shaders::collision_circle, gfx::PrimitiveType::Triangle, TypeListConcat, TypeList< @@ -153,11 +149,11 @@ public: template void draw(gfx::Context& context, - DrawMode drawMode, - gfx::DepthMode depthMode, - gfx::StencilMode stencilMode, - gfx::ColorMode colorMode, - gfx::CullFaceMode cullFaceMode, + const DrawMode& drawMode, + const gfx::DepthMode& depthMode, + const gfx::StencilMode& stencilMode, + const gfx::ColorMode& colorMode, + const gfx::CullFaceMode& cullFaceMode, const LayoutUniformValues& layoutUniformValues, const gfx::VertexBuffer>& layoutVertexBuffer, const gfx::VertexBuffer>& dynamicVertexBuffer, diff --git a/src/mbgl/programs/collision_circle_program.hpp b/src/mbgl/programs/collision_circle_program.hpp new file mode 100644 index 0000000000..1fd36af360 --- /dev/null +++ b/src/mbgl/programs/collision_circle_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/debug_program.cpp b/src/mbgl/programs/debug_program.cpp new file mode 100644 index 0000000000..9b8df789e4 --- /dev/null +++ b/src/mbgl/programs/debug_program.cpp @@ -0,0 +1,8 @@ +#include +#include + +namespace mbgl { + +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + +} // namespace mbgl diff --git a/src/mbgl/programs/debug_program.hpp b/src/mbgl/programs/debug_program.hpp index f1b814d5e0..61125b55bf 100644 --- a/src/mbgl/programs/debug_program.hpp +++ b/src/mbgl/programs/debug_program.hpp @@ -3,14 +3,12 @@ #include #include #include -#include #include namespace mbgl { class DebugProgram : public Program< DebugProgram, - shaders::debug, gfx::PrimitiveType::Line, TypeList< attributes::a_pos>, diff --git a/src/mbgl/programs/extrusion_texture_program.cpp b/src/mbgl/programs/extrusion_texture_program.cpp index afda4384b7..50fcd76221 100644 --- a/src/mbgl/programs/extrusion_texture_program.cpp +++ b/src/mbgl/programs/extrusion_texture_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(ExtrusionTextureLayoutVertex) == 4, "expected ExtrusionTextureLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/extrusion_texture_program.hpp b/src/mbgl/programs/extrusion_texture_program.hpp index eb97b9e11f..bdeeabb8cd 100644 --- a/src/mbgl/programs/extrusion_texture_program.hpp +++ b/src/mbgl/programs/extrusion_texture_program.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -12,7 +11,6 @@ namespace mbgl { class ExtrusionTextureProgram : public Program< ExtrusionTextureProgram, - shaders::extrusion_texture, gfx::PrimitiveType::Triangle, TypeList, TypeList< diff --git a/src/mbgl/programs/fill_extrusion_pattern_program.hpp b/src/mbgl/programs/fill_extrusion_pattern_program.hpp new file mode 100644 index 0000000000..b723ce0614 --- /dev/null +++ b/src/mbgl/programs/fill_extrusion_pattern_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/fill_extrusion_program.cpp b/src/mbgl/programs/fill_extrusion_program.cpp index a2117bddef..7688d09299 100644 --- a/src/mbgl/programs/fill_extrusion_program.cpp +++ b/src/mbgl/programs/fill_extrusion_program.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -7,6 +8,9 @@ namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + using namespace style; static_assert(sizeof(FillExtrusionLayoutVertex) == 12, "expected FillExtrusionLayoutVertex size"); diff --git a/src/mbgl/programs/fill_extrusion_program.hpp b/src/mbgl/programs/fill_extrusion_program.hpp index 23a38e2469..e1c3ca7f17 100644 --- a/src/mbgl/programs/fill_extrusion_program.hpp +++ b/src/mbgl/programs/fill_extrusion_program.hpp @@ -5,8 +5,6 @@ #include #include #include -#include -#include #include #include #include @@ -54,7 +52,6 @@ using FillExtrusionPatternUniforms = TypeList< class FillExtrusionProgram : public Program< FillExtrusionProgram, - shaders::fill_extrusion, gfx::PrimitiveType::Triangle, FillExtrusionLayoutAttributes, FillExtrusionUniforms, @@ -90,7 +87,6 @@ public: class FillExtrusionPatternProgram : public Program< FillExtrusionPatternProgram, - shaders::fill_extrusion_pattern, gfx::PrimitiveType::Triangle, FillExtrusionLayoutAttributes, FillExtrusionPatternUniforms, @@ -117,7 +113,7 @@ using FillExtrusionAttributes = FillExtrusionProgram::AttributeList; class FillExtrusionLayerPrograms final : public LayerTypePrograms { public: - FillExtrusionLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + FillExtrusionLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : fillExtrusion(context, programParameters), fillExtrusionPattern(context, programParameters), extrusionTexture(context, programParameters) {} diff --git a/src/mbgl/programs/fill_outline_pattern_program.hpp b/src/mbgl/programs/fill_outline_pattern_program.hpp new file mode 100644 index 0000000000..a2c26a168d --- /dev/null +++ b/src/mbgl/programs/fill_outline_pattern_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/fill_outline_program.hpp b/src/mbgl/programs/fill_outline_program.hpp new file mode 100644 index 0000000000..a2c26a168d --- /dev/null +++ b/src/mbgl/programs/fill_outline_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/fill_pattern_program.hpp b/src/mbgl/programs/fill_pattern_program.hpp new file mode 100644 index 0000000000..a2c26a168d --- /dev/null +++ b/src/mbgl/programs/fill_pattern_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/fill_program.cpp b/src/mbgl/programs/fill_program.cpp index 6f1509245f..e0dfc71f81 100644 --- a/src/mbgl/programs/fill_program.cpp +++ b/src/mbgl/programs/fill_program.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -6,6 +7,11 @@ namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + using namespace style; static_assert(sizeof(FillLayoutVertex) == 4, "expected FillLayoutVertex size"); diff --git a/src/mbgl/programs/fill_program.hpp b/src/mbgl/programs/fill_program.hpp index 5778dfe2d9..8519e482d6 100644 --- a/src/mbgl/programs/fill_program.hpp +++ b/src/mbgl/programs/fill_program.hpp @@ -4,10 +4,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include @@ -39,7 +35,6 @@ using FillPatternUniforms = TypeList< class FillProgram : public Program< FillProgram, - shaders::fill, gfx::PrimitiveType::Triangle, FillLayoutAttributes, FillUniforms, @@ -61,7 +56,6 @@ public: class FillPatternProgram : public Program< FillPatternProgram, - shaders::fill_pattern, gfx::PrimitiveType::Triangle, FillLayoutAttributes, FillPatternUniforms, @@ -83,7 +77,6 @@ public: class FillOutlineProgram : public Program< FillOutlineProgram, - shaders::fill_outline, gfx::PrimitiveType::Line, FillLayoutAttributes, FillUniforms, @@ -96,7 +89,6 @@ public: class FillOutlinePatternProgram : public Program< FillOutlinePatternProgram, - shaders::fill_outline_pattern, gfx::PrimitiveType::Line, FillLayoutAttributes, FillPatternUniforms, @@ -113,7 +105,7 @@ using FillAttributes = FillProgram::AttributeList; class FillLayerPrograms final : public LayerTypePrograms { public: - FillLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + FillLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : fill(context, programParameters), fillPattern(context, programParameters), fillOutline(context, programParameters), diff --git a/src/mbgl/programs/gl/background.cpp b/src/mbgl/programs/gl/background.cpp new file mode 100644 index 0000000000..da5ea25410 --- /dev/null +++ b/src/mbgl/programs/gl/background.cpp @@ -0,0 +1,47 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "background", + programs::gl::shaderSource() + 1429, programs::gl::shaderSource() + 1525); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of background.vertex.glsl: +/* +attribute vec2 a_pos; + +uniform mat4 u_matrix; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); +} + +*/ + +// Uncompressed source of background.fragment.glsl: +/* +uniform vec4 u_color; +uniform float u_opacity; + +void main() { + gl_FragColor = u_color * u_opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/background_pattern.cpp b/src/mbgl/programs/gl/background_pattern.cpp new file mode 100644 index 0000000000..af5d87129e --- /dev/null +++ b/src/mbgl/programs/gl/background_pattern.cpp @@ -0,0 +1,78 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "background_pattern", + programs::gl::shaderSource() + 1675, programs::gl::shaderSource() + 2266); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of background_pattern.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_pattern_size_a; +uniform vec2 u_pattern_size_b; +uniform vec2 u_pixel_coord_upper; +uniform vec2 u_pixel_coord_lower; +uniform float u_scale_a; +uniform float u_scale_b; +uniform float u_tile_units_to_pixels; + +attribute vec2 a_pos; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); + + v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos); + v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos); +} + +*/ + +// Uncompressed source of background_pattern.fragment.glsl: +/* +uniform vec2 u_pattern_tl_a; +uniform vec2 u_pattern_br_a; +uniform vec2 u_pattern_tl_b; +uniform vec2 u_pattern_br_b; +uniform vec2 u_texsize; +uniform float u_mix; +uniform float u_opacity; + +uniform sampler2D u_image; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; + +void main() { + vec2 imagecoord = mod(v_pos_a, 1.0); + vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord); + vec4 color1 = texture2D(u_image, pos); + + vec2 imagecoord_b = mod(v_pos_b, 1.0); + vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b); + vec4 color2 = texture2D(u_image, pos2); + + gl_FragColor = mix(color1, color2, u_mix) * u_opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/circle.cpp b/src/mbgl/programs/gl/circle.cpp new file mode 100644 index 0000000000..04c3f60870 --- /dev/null +++ b/src/mbgl/programs/gl/circle.cpp @@ -0,0 +1,300 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "circle", + programs::gl::shaderSource() + 2927, programs::gl::shaderSource() + 6093); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of circle.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform bool u_scale_with_map; +uniform bool u_pitch_with_map; +uniform vec2 u_extrude_scale; +uniform highp float u_camera_to_center_distance; + +attribute vec2 a_pos; + + +#ifndef HAS_UNIFORM_u_color +uniform lowp float a_color_t; +attribute highp vec4 a_color; +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_radius +uniform lowp float a_radius_t; +attribute mediump vec2 a_radius; +varying mediump float radius; +#else +uniform mediump float u_radius; +#endif + + +#ifndef HAS_UNIFORM_u_blur +uniform lowp float a_blur_t; +attribute lowp vec2 a_blur; +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_color +uniform lowp float a_stroke_color_t; +attribute highp vec4 a_stroke_color; +varying highp vec4 stroke_color; +#else +uniform highp vec4 u_stroke_color; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_width +uniform lowp float a_stroke_width_t; +attribute mediump vec2 a_stroke_width; +varying mediump float stroke_width; +#else +uniform mediump float u_stroke_width; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_opacity +uniform lowp float a_stroke_opacity_t; +attribute lowp vec2 a_stroke_opacity; +varying lowp float stroke_opacity; +#else +uniform lowp float u_stroke_opacity; +#endif + + +varying vec3 v_data; + +void main(void) { + +#ifndef HAS_UNIFORM_u_color + color = unpack_mix_color(a_color, a_color_t); +#else + highp vec4 color = u_color; +#endif + + +#ifndef HAS_UNIFORM_u_radius + radius = unpack_mix_vec2(a_radius, a_radius_t); +#else + mediump float radius = u_radius; +#endif + + +#ifndef HAS_UNIFORM_u_blur + blur = unpack_mix_vec2(a_blur, a_blur_t); +#else + lowp float blur = u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_color + stroke_color = unpack_mix_color(a_stroke_color, a_stroke_color_t); +#else + highp vec4 stroke_color = u_stroke_color; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_width + stroke_width = unpack_mix_vec2(a_stroke_width, a_stroke_width_t); +#else + mediump float stroke_width = u_stroke_width; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_opacity + stroke_opacity = unpack_mix_vec2(a_stroke_opacity, a_stroke_opacity_t); +#else + lowp float stroke_opacity = u_stroke_opacity; +#endif + + + // unencode the extrusion vector that we snuck into the a_pos vector + vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); + + // multiply a_pos by 0.5, since we had it * 2 in order to sneak + // in extrusion data + vec2 circle_center = floor(a_pos * 0.5); + if (u_pitch_with_map) { + vec2 corner_position = circle_center; + if (u_scale_with_map) { + corner_position += extrude * (radius + stroke_width) * u_extrude_scale; + } else { + // Pitching the circle with the map effectively scales it with the map + // To counteract the effect for pitch-scale: viewport, we rescale the + // whole circle based on the pitch scaling effect at its central point + vec4 projected_center = u_matrix * vec4(circle_center, 0, 1); + corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance); + } + + gl_Position = u_matrix * vec4(corner_position, 0, 1); + } else { + gl_Position = u_matrix * vec4(circle_center, 0, 1); + + if (u_scale_with_map) { + gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance; + } else { + gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w; + } + } + + // This is a minimum blur distance that serves as a faux-antialiasing for + // the circle. since blur is a ratio of the circle's size and the intent is + // to keep the blur at roughly 1px, the two are inversely related. + lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width); + + v_data = vec3(extrude.x, extrude.y, antialiasblur); +} + +*/ + +// Uncompressed source of circle.fragment.glsl: +/* + +#ifndef HAS_UNIFORM_u_color +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_radius +varying mediump float radius; +#else +uniform mediump float u_radius; +#endif + + +#ifndef HAS_UNIFORM_u_blur +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_color +varying highp vec4 stroke_color; +#else +uniform highp vec4 u_stroke_color; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_width +varying mediump float stroke_width; +#else +uniform mediump float u_stroke_width; +#endif + + +#ifndef HAS_UNIFORM_u_stroke_opacity +varying lowp float stroke_opacity; +#else +uniform lowp float u_stroke_opacity; +#endif + + +varying vec3 v_data; + +void main() { + +#ifdef HAS_UNIFORM_u_color + highp vec4 color = u_color; +#endif + + +#ifdef HAS_UNIFORM_u_radius + mediump float radius = u_radius; +#endif + + +#ifdef HAS_UNIFORM_u_blur + lowp float blur = u_blur; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + +#ifdef HAS_UNIFORM_u_stroke_color + highp vec4 stroke_color = u_stroke_color; +#endif + + +#ifdef HAS_UNIFORM_u_stroke_width + mediump float stroke_width = u_stroke_width; +#endif + + +#ifdef HAS_UNIFORM_u_stroke_opacity + lowp float stroke_opacity = u_stroke_opacity; +#endif + + + vec2 extrude = v_data.xy; + float extrude_length = length(extrude); + + lowp float antialiasblur = v_data.z; + float antialiased_blur = -max(blur, antialiasblur); + + float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0); + + float color_t = stroke_width < 0.01 ? 0.0 : smoothstep( + antialiased_blur, + 0.0, + extrude_length - radius / (radius + stroke_width) + ); + + gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/clipping_mask.cpp b/src/mbgl/programs/gl/clipping_mask.cpp new file mode 100644 index 0000000000..311877f065 --- /dev/null +++ b/src/mbgl/programs/gl/clipping_mask.cpp @@ -0,0 +1,40 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "clipping_mask", + programs::gl::shaderSource() + 7848, programs::gl::shaderSource() + 7944); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of clipping_mask.vertex.glsl: +/* +attribute vec2 a_pos; + +uniform mat4 u_matrix; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); +} + +*/ + +// Uncompressed source of clipping_mask.fragment.glsl: +/* +void main() { + gl_FragColor = vec4(1.0); +} + +*/ + diff --git a/src/mbgl/programs/gl/collision_box.cpp b/src/mbgl/programs/gl/collision_box.cpp new file mode 100644 index 0000000000..9af67f7981 --- /dev/null +++ b/src/mbgl/programs/gl/collision_box.cpp @@ -0,0 +1,77 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "collision_box", + programs::gl::shaderSource() + 9956, programs::gl::shaderSource() + 10635); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of collision_box.vertex.glsl: +/* +attribute vec2 a_pos; +attribute vec2 a_anchor_pos; +attribute vec2 a_extrude; +attribute vec2 a_placed; +attribute vec2 a_shift; + +uniform mat4 u_matrix; +uniform vec2 u_extrude_scale; +uniform float u_camera_to_center_distance; + +varying float v_placed; +varying float v_notUsed; + +void main() { + vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1); + highp float camera_to_anchor_distance = projectedPoint.w; + highp float collision_perspective_ratio = clamp( + 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance), + 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles + 4.0); + + gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0); + gl_Position.xy += (a_extrude + a_shift) * u_extrude_scale * gl_Position.w * collision_perspective_ratio; + + v_placed = a_placed.x; + v_notUsed = a_placed.y; +} + +*/ + +// Uncompressed source of collision_box.fragment.glsl: +/* + +varying float v_placed; +varying float v_notUsed; + +void main() { + + float alpha = 0.5; + + // Red = collision, hide label + gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha; + + // Blue = no collision, label is showing + if (v_placed > 0.5) { + gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha; + } + + if (v_notUsed > 0.5) { + // This box not used, fade it out + gl_FragColor *= .1; + } +} +*/ + diff --git a/src/mbgl/programs/gl/collision_circle.cpp b/src/mbgl/programs/gl/collision_circle.cpp new file mode 100644 index 0000000000..843f9161bb --- /dev/null +++ b/src/mbgl/programs/gl/collision_circle.cpp @@ -0,0 +1,100 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "collision_circle", + programs::gl::shaderSource() + 10858, programs::gl::shaderSource() + 11774); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of collision_circle.vertex.glsl: +/* +attribute vec2 a_pos; +attribute vec2 a_anchor_pos; +attribute vec2 a_extrude; +attribute vec2 a_placed; + +uniform mat4 u_matrix; +uniform vec2 u_extrude_scale; +uniform float u_camera_to_center_distance; + +varying float v_placed; +varying float v_notUsed; +varying float v_radius; + +varying vec2 v_extrude; +varying vec2 v_extrude_scale; + +void main() { + vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1); + highp float camera_to_anchor_distance = projectedPoint.w; + highp float collision_perspective_ratio = clamp( + 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance), + 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles + 4.0); + + gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0); + + highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur + gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio; + + v_placed = a_placed.x; + v_notUsed = a_placed.y; + v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius + + v_extrude = a_extrude * padding_factor; + v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio; +} + +*/ + +// Uncompressed source of collision_circle.fragment.glsl: +/* +uniform float u_overscale_factor; + +varying float v_placed; +varying float v_notUsed; +varying float v_radius; +varying vec2 v_extrude; +varying vec2 v_extrude_scale; + +void main() { + float alpha = 0.5; + + // Red = collision, hide label + vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha; + + // Blue = no collision, label is showing + if (v_placed > 0.5) { + color = vec4(0.0, 0.0, 1.0, 0.5) * alpha; + } + + if (v_notUsed > 0.5) { + // This box not used, fade it out + color *= .2; + } + + float extrude_scale_length = length(v_extrude_scale); + float extrude_length = length(v_extrude) * extrude_scale_length; + float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor; + float radius = v_radius * extrude_scale_length; + + float distance_to_edge = abs(extrude_length - radius); + float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge); + + gl_FragColor = opacity_t * color; +} + +*/ + diff --git a/src/mbgl/programs/gl/debug.cpp b/src/mbgl/programs/gl/debug.cpp new file mode 100644 index 0000000000..8b7aee5a0b --- /dev/null +++ b/src/mbgl/programs/gl/debug.cpp @@ -0,0 +1,42 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "debug", + programs::gl::shaderSource() + 12450, programs::gl::shaderSource() + 12546); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of debug.vertex.glsl: +/* +attribute vec2 a_pos; + +uniform mat4 u_matrix; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); +} + +*/ + +// Uncompressed source of debug.fragment.glsl: +/* +uniform highp vec4 u_color; + +void main() { + gl_FragColor = u_color; +} + +*/ + diff --git a/src/mbgl/programs/gl/extrusion_texture.cpp b/src/mbgl/programs/gl/extrusion_texture.cpp new file mode 100644 index 0000000000..bd320d52cf --- /dev/null +++ b/src/mbgl/programs/gl/extrusion_texture.cpp @@ -0,0 +1,52 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "extrusion_texture", + programs::gl::shaderSource() + 27554, programs::gl::shaderSource() + 27734); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of extrusion_texture.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_world; +attribute vec2 a_pos; +varying vec2 v_pos; + +void main() { + gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1); + + v_pos.x = a_pos.x; + v_pos.y = 1.0 - a_pos.y; +} + +*/ + +// Uncompressed source of extrusion_texture.fragment.glsl: +/* +uniform sampler2D u_image; +uniform float u_opacity; +varying vec2 v_pos; + +void main() { + gl_FragColor = texture2D(u_image, v_pos) * u_opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(0.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/fill.cpp b/src/mbgl/programs/gl/fill.cpp new file mode 100644 index 0000000000..c15c2774ab --- /dev/null +++ b/src/mbgl/programs/gl/fill.cpp @@ -0,0 +1,104 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "fill", + programs::gl::shaderSource() + 12610, programs::gl::shaderSource() + 13254); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of fill.vertex.glsl: +/* +attribute vec2 a_pos; + +uniform mat4 u_matrix; + + +#ifndef HAS_UNIFORM_u_color +uniform lowp float a_color_t; +attribute highp vec4 a_color; +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_color + color = unpack_mix_color(a_color, a_color_t); +#else + highp vec4 color = u_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + + gl_Position = u_matrix * vec4(a_pos, 0, 1); +} + +*/ + +// Uncompressed source of fill.fragment.glsl: +/* + +#ifndef HAS_UNIFORM_u_color +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +void main() { + +#ifdef HAS_UNIFORM_u_color + highp vec4 color = u_color; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + + gl_FragColor = color * opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/fill_extrusion.cpp b/src/mbgl/programs/gl/fill_extrusion.cpp new file mode 100644 index 0000000000..45ebb68dd4 --- /dev/null +++ b/src/mbgl/programs/gl/fill_extrusion.cpp @@ -0,0 +1,142 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "fill_extrusion", + programs::gl::shaderSource() + 21238, programs::gl::shaderSource() + 23121); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of fill_extrusion.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec3 u_lightcolor; +uniform lowp vec3 u_lightpos; +uniform lowp float u_lightintensity; +uniform float u_vertical_gradient; + +attribute vec2 a_pos; +attribute vec4 a_normal_ed; + +varying vec4 v_color; + + +#ifndef HAS_UNIFORM_u_base +uniform lowp float a_base_t; +attribute highp vec2 a_base; +#else +uniform highp float u_base; +#endif + + +#ifndef HAS_UNIFORM_u_height +uniform lowp float a_height_t; +attribute highp vec2 a_height; +#else +uniform highp float u_height; +#endif + + + +#ifndef HAS_UNIFORM_u_color +uniform lowp float a_color_t; +attribute highp vec4 a_color; +#else +uniform highp vec4 u_color; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_base + highp float base = unpack_mix_vec2(a_base, a_base_t); +#else + highp float base = u_base; +#endif + + +#ifndef HAS_UNIFORM_u_height + highp float height = unpack_mix_vec2(a_height, a_height_t); +#else + highp float height = u_height; +#endif + + +#ifndef HAS_UNIFORM_u_color + highp vec4 color = unpack_mix_color(a_color, a_color_t); +#else + highp vec4 color = u_color; +#endif + + + vec3 normal = a_normal_ed.xyz; + + base = max(0.0, base); + height = max(0.0, height); + + float t = mod(normal.x, 2.0); + + gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1); + + // Relative luminance (how dark/bright is the surface color?) + float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722; + + v_color = vec4(0.0, 0.0, 0.0, 1.0); + + // Add slight ambient lighting so no extrusions are totally black + vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0); + color += ambientlight; + + // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray + float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0); + + // Adjust directional so that + // the range of values for highlight/shading is narrower + // with lower light intensity + // and with lighter/brighter surface colors + directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional); + + // Add gradient along z axis of side surfaces + if (normal.y != 0.0) { + // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient, + // and otherwise calculates the gradient based on base + height + directional *= ( + (1.0 - u_vertical_gradient) + + (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0))); + } + + // Assign final color based on surface + ambient light color, diffuse light directional, and light color + // with lower bounds adjusted to hue of light + // so that shading is tinted with the complementary (opposite) color to the light color + v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0); + v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0); + v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0); +} + +*/ + +// Uncompressed source of fill_extrusion.fragment.glsl: +/* +varying vec4 v_color; + +void main() { + gl_FragColor = v_color; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/fill_extrusion_pattern.cpp b/src/mbgl/programs/gl/fill_extrusion_pattern.cpp new file mode 100644 index 0000000000..9c2da87b11 --- /dev/null +++ b/src/mbgl/programs/gl/fill_extrusion_pattern.cpp @@ -0,0 +1,241 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "fill_extrusion_pattern", + programs::gl::shaderSource() + 23237, programs::gl::shaderSource() + 26157); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of fill_extrusion_pattern.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_pixel_coord_upper; +uniform vec2 u_pixel_coord_lower; +uniform float u_height_factor; +uniform vec4 u_scale; +uniform float u_vertical_gradient; + +uniform vec3 u_lightcolor; +uniform lowp vec3 u_lightpos; +uniform lowp float u_lightintensity; + +attribute vec2 a_pos; +attribute vec4 a_normal_ed; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; +varying vec4 v_lighting; + + +#ifndef HAS_UNIFORM_u_base +uniform lowp float a_base_t; +attribute lowp vec2 a_base; +varying lowp float base; +#else +uniform lowp float u_base; +#endif + + +#ifndef HAS_UNIFORM_u_height +uniform lowp float a_height_t; +attribute lowp vec2 a_height; +varying lowp float height; +#else +uniform lowp float u_height; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +uniform lowp float a_pattern_from_t; +attribute lowp vec4 a_pattern_from; +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +uniform lowp float a_pattern_to_t; +attribute lowp vec4 a_pattern_to; +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_base + base = unpack_mix_vec2(a_base, a_base_t); +#else + lowp float base = u_base; +#endif + + +#ifndef HAS_UNIFORM_u_height + height = unpack_mix_vec2(a_height, a_height_t); +#else + lowp float height = u_height; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from + pattern_from = a_pattern_from; +#else + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to + pattern_to = a_pattern_to; +#else + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + float pixelRatio = u_scale.x; + float tileRatio = u_scale.y; + float fromScale = u_scale.z; + float toScale = u_scale.w; + + vec3 normal = a_normal_ed.xyz; + float edgedistance = a_normal_ed.w; + + vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); + vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); + + base = max(0.0, base); + height = max(0.0, height); + + float t = mod(normal.x, 2.0); + float z = t > 0.0 ? height : base; + + gl_Position = u_matrix * vec4(a_pos, z, 1); + + vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0 + ? a_pos // extrusion top + : vec2(edgedistance, z * u_height_factor); // extrusion side + + v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, pos); + v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, pos); + + v_lighting = vec4(0.0, 0.0, 0.0, 1.0); + float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0); + directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional); + + if (normal.y != 0.0) { + // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient, + // and otherwise calculates the gradient based on base + height + directional *= ( + (1.0 - u_vertical_gradient) + + (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0))); + } + + v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0)); +} + +*/ + +// Uncompressed source of fill_extrusion_pattern.fragment.glsl: +/* +uniform vec2 u_texsize; +uniform float u_fade; + +uniform sampler2D u_image; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; +varying vec4 v_lighting; + + +#ifndef HAS_UNIFORM_u_base +varying lowp float base; +#else +uniform lowp float u_base; +#endif + + +#ifndef HAS_UNIFORM_u_height +varying lowp float height; +#else +uniform lowp float u_height; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifdef HAS_UNIFORM_u_base + lowp float base = u_base; +#endif + + +#ifdef HAS_UNIFORM_u_height + lowp float height = u_height; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_from + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_to + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + vec2 imagecoord = mod(v_pos_a, 1.0); + vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord); + vec4 color1 = texture2D(u_image, pos); + + vec2 imagecoord_b = mod(v_pos_b, 1.0); + vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b); + vec4 color2 = texture2D(u_image, pos2); + + vec4 mixedColor = mix(color1, color2, u_fade); + + gl_FragColor = mixedColor * v_lighting; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/fill_outline.cpp b/src/mbgl/programs/gl/fill_outline.cpp new file mode 100644 index 0000000000..07615b2138 --- /dev/null +++ b/src/mbgl/programs/gl/fill_outline.cpp @@ -0,0 +1,112 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "fill_outline", + programs::gl::shaderSource() + 13678, programs::gl::shaderSource() + 14503); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of fill_outline.vertex.glsl: +/* +attribute vec2 a_pos; + +uniform mat4 u_matrix; +uniform vec2 u_world; + +varying vec2 v_pos; + + +#ifndef HAS_UNIFORM_u_outline_color +uniform lowp float a_outline_color_t; +attribute highp vec4 a_outline_color; +varying highp vec4 outline_color; +#else +uniform highp vec4 u_outline_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_outline_color + outline_color = unpack_mix_color(a_outline_color, a_outline_color_t); +#else + highp vec4 outline_color = u_outline_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + + gl_Position = u_matrix * vec4(a_pos, 0, 1); + v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world; +} + +*/ + +// Uncompressed source of fill_outline.fragment.glsl: +/* + +#ifndef HAS_UNIFORM_u_outline_color +varying highp vec4 outline_color; +#else +uniform highp vec4 u_outline_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +varying vec2 v_pos; + +void main() { + +#ifdef HAS_UNIFORM_u_outline_color + highp vec4 outline_color = u_outline_color; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + + float dist = length(v_pos - gl_FragCoord.xy); + float alpha = 1.0 - smoothstep(0.0, 1.0, dist); + gl_FragColor = outline_color * (alpha * opacity); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/fill_outline_pattern.cpp b/src/mbgl/programs/gl/fill_outline_pattern.cpp new file mode 100644 index 0000000000..7e0bf19655 --- /dev/null +++ b/src/mbgl/programs/gl/fill_outline_pattern.cpp @@ -0,0 +1,186 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "fill_outline_pattern", + programs::gl::shaderSource() + 15092, programs::gl::shaderSource() + 16952); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of fill_outline_pattern.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_world; +uniform vec2 u_pixel_coord_upper; +uniform vec2 u_pixel_coord_lower; +uniform vec4 u_scale; + +attribute vec2 a_pos; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; +varying vec2 v_pos; + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +uniform lowp float a_pattern_from_t; +attribute lowp vec4 a_pattern_from; +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +uniform lowp float a_pattern_to_t; +attribute lowp vec4 a_pattern_to; +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from + pattern_from = a_pattern_from; +#else + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to + pattern_to = a_pattern_to; +#else + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + float pixelRatio = u_scale.x; + float tileRatio = u_scale.y; + float fromScale = u_scale.z; + float toScale = u_scale.w; + + gl_Position = u_matrix * vec4(a_pos, 0, 1); + + vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); + vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); + + v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, a_pos); + v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, a_pos); + + v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world; +} + +*/ + +// Uncompressed source of fill_outline_pattern.fragment.glsl: +/* + +uniform vec2 u_texsize; +uniform sampler2D u_image; +uniform float u_fade; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; +varying vec2 v_pos; + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_from + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_to + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + vec2 imagecoord = mod(v_pos_a, 1.0); + vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord); + vec4 color1 = texture2D(u_image, pos); + + vec2 imagecoord_b = mod(v_pos_b, 1.0); + vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b); + vec4 color2 = texture2D(u_image, pos2); + + // find distance to outline for alpha interpolation + + float dist = length(v_pos - gl_FragCoord.xy); + float alpha = 1.0 - smoothstep(0.0, 1.0, dist); + + + gl_FragColor = mix(color1, color2, u_fade) * alpha * opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/fill_pattern.cpp b/src/mbgl/programs/gl/fill_pattern.cpp new file mode 100644 index 0000000000..256b1ede99 --- /dev/null +++ b/src/mbgl/programs/gl/fill_pattern.cpp @@ -0,0 +1,174 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "fill_pattern", + programs::gl::shaderSource() + 18259, programs::gl::shaderSource() + 20038); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of fill_pattern.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_pixel_coord_upper; +uniform vec2 u_pixel_coord_lower; +uniform vec4 u_scale; + +attribute vec2 a_pos; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +uniform lowp float a_pattern_from_t; +attribute lowp vec4 a_pattern_from; +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +uniform lowp float a_pattern_to_t; +attribute lowp vec4 a_pattern_to; +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from + pattern_from = a_pattern_from; +#else + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to + pattern_to = a_pattern_to; +#else + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + float pixelRatio = u_scale.x; + float tileZoomRatio = u_scale.y; + float fromScale = u_scale.z; + float toScale = u_scale.w; + + vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); + vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); + gl_Position = u_matrix * vec4(a_pos, 0, 1); + + v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileZoomRatio, a_pos); + v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileZoomRatio, a_pos); +} + +*/ + +// Uncompressed source of fill_pattern.fragment.glsl: +/* +uniform vec2 u_texsize; +uniform float u_fade; + +uniform sampler2D u_image; + +varying vec2 v_pos_a; +varying vec2 v_pos_b; + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_from + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_to + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + vec2 imagecoord = mod(v_pos_a, 1.0); + vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord); + vec4 color1 = texture2D(u_image, pos); + + vec2 imagecoord_b = mod(v_pos_b, 1.0); + vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b); + vec4 color2 = texture2D(u_image, pos2); + + gl_FragColor = mix(color1, color2, u_fade) * opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/heatmap.cpp b/src/mbgl/programs/gl/heatmap.cpp new file mode 100644 index 0000000000..59f8ad9f69 --- /dev/null +++ b/src/mbgl/programs/gl/heatmap.cpp @@ -0,0 +1,141 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "heatmap", + programs::gl::shaderSource() + 7983, programs::gl::shaderSource() + 9030); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of heatmap.vertex.glsl: +/* + +#ifndef HAS_UNIFORM_u_weight +uniform lowp float a_weight_t; +attribute highp vec2 a_weight; +varying highp float weight; +#else +uniform highp float u_weight; +#endif + + +#ifndef HAS_UNIFORM_u_radius +uniform lowp float a_radius_t; +attribute mediump vec2 a_radius; +#else +uniform mediump float u_radius; +#endif + + +uniform mat4 u_matrix; +uniform float u_extrude_scale; +uniform float u_opacity; +uniform float u_intensity; + +attribute vec2 a_pos; + +varying vec2 v_extrude; + +// Effective "0" in the kernel density texture to adjust the kernel size to; +// this empirically chosen number minimizes artifacts on overlapping kernels +// for typical heatmap cases (assuming clustered source) +const highp float ZERO = 1.0 / 255.0 / 16.0; + +// Gaussian kernel coefficient: 1 / sqrt(2 * PI) +#define GAUSS_COEF 0.3989422804014327 + +void main(void) { + +#ifndef HAS_UNIFORM_u_weight + weight = unpack_mix_vec2(a_weight, a_weight_t); +#else + highp float weight = u_weight; +#endif + + +#ifndef HAS_UNIFORM_u_radius + mediump float radius = unpack_mix_vec2(a_radius, a_radius_t); +#else + mediump float radius = u_radius; +#endif + + + // unencode the extrusion vector that we snuck into the a_pos vector + vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); + + // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use + // it to produce the vertices of a square mesh framing the point feature + // we're adding to the kernel density texture. We'll also pass it as + // a varying, so that the fragment shader can determine the distance of + // each fragment from the point feature. + // Before we do so, we need to scale it up sufficiently so that the + // kernel falls effectively to zero at the edge of the mesh. + // That is, we want to know S such that + // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO + // Which solves to: + // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0 + float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0; + + // Pass the varying in units of radius + v_extrude = S * unscaled_extrude; + + // Scale by radius and the zoom-based scale factor to produce actual + // mesh position + vec2 extrude = v_extrude * radius * u_extrude_scale; + + // multiply a_pos by 0.5, since we had it * 2 in order to sneak + // in extrusion data + vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1); + + gl_Position = u_matrix * pos; +} + +*/ + +// Uncompressed source of heatmap.fragment.glsl: +/* + +#ifndef HAS_UNIFORM_u_weight +varying highp float weight; +#else +uniform highp float u_weight; +#endif + + +uniform highp float u_intensity; +varying vec2 v_extrude; + +// Gaussian kernel coefficient: 1 / sqrt(2 * PI) +#define GAUSS_COEF 0.3989422804014327 + +void main() { + +#ifdef HAS_UNIFORM_u_weight + highp float weight = u_weight; +#endif + + + // Kernel density estimation with a Gaussian kernel of size 5x5 + float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude); + float val = weight * u_intensity * GAUSS_COEF * exp(d); + + gl_FragColor = vec4(val, 1.0, 1.0, 1.0); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/heatmap_texture.cpp b/src/mbgl/programs/gl/heatmap_texture.cpp new file mode 100644 index 0000000000..530e9fa18b --- /dev/null +++ b/src/mbgl/programs/gl/heatmap_texture.cpp @@ -0,0 +1,55 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "heatmap_texture", + programs::gl::shaderSource() + 9491, programs::gl::shaderSource() + 9671); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of heatmap_texture.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_world; +attribute vec2 a_pos; +varying vec2 v_pos; + +void main() { + gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1); + + v_pos.x = a_pos.x; + v_pos.y = 1.0 - a_pos.y; +} + +*/ + +// Uncompressed source of heatmap_texture.fragment.glsl: +/* +uniform sampler2D u_image; +uniform sampler2D u_color_ramp; +uniform float u_opacity; +varying vec2 v_pos; + +void main() { + float t = texture2D(u_image, v_pos).r; + vec4 color = texture2D(u_color_ramp, vec2(t, 0.5)); + gl_FragColor = color * u_opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(0.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/hillshade.cpp b/src/mbgl/programs/gl/hillshade.cpp new file mode 100644 index 0000000000..dcf90f1149 --- /dev/null +++ b/src/mbgl/programs/gl/hillshade.cpp @@ -0,0 +1,93 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "hillshade", + programs::gl::shaderSource() + 29340, programs::gl::shaderSource() + 29511); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of hillshade.vertex.glsl: +/* +uniform mat4 u_matrix; + +attribute vec2 a_pos; +attribute vec2 a_texture_pos; + +varying vec2 v_pos; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); + v_pos = a_texture_pos / 8192.0; +} + +*/ + +// Uncompressed source of hillshade.fragment.glsl: +/* +uniform sampler2D u_image; +varying vec2 v_pos; + +uniform vec2 u_latrange; +uniform vec2 u_light; +uniform vec4 u_shadow; +uniform vec4 u_highlight; +uniform vec4 u_accent; + +#define PI 3.141592653589793 + +void main() { + vec4 pixel = texture2D(u_image, v_pos); + + vec2 deriv = ((pixel.rg * 2.0) - 1.0); + + // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude + // to account for mercator projection distortion. see #4807 for details + float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1])); + // We also multiply the slope by an arbitrary z-factor of 1.25 + float slope = atan(1.25 * length(deriv) / scaleFactor); + float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0); + + float intensity = u_light.x; + // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal + // position property to account for 0deg corresponding to north/the top of the viewport in the style spec + // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal. + float azimuth = u_light.y + PI; + + // We scale the slope exponentially based on intensity, using a calculation similar to + // the exponential interpolation function in the style spec: + // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228 + // so that higher intensity values create more opaque hillshading. + float base = 1.875 - intensity * 1.75; + float maxValue = 0.5 * PI; + float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope; + + // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine + // so that the accent color's rate of change eases in while the shade color's eases out. + float accent = cos(scaledSlope); + // We multiply both the accent and shade color by a clamped intensity value + // so that intensities >= 0.5 do not additionally affect the color values + // while intensity values < 0.5 make the overall color more transparent. + vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0); + float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0); + vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0); + gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/hillshade_prepare.cpp b/src/mbgl/programs/gl/hillshade_prepare.cpp new file mode 100644 index 0000000000..b445713530 --- /dev/null +++ b/src/mbgl/programs/gl/hillshade_prepare.cpp @@ -0,0 +1,117 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "hillshade_prepare", + programs::gl::shaderSource() + 27925, programs::gl::shaderSource() + 28218); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of hillshade_prepare.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_dimension; + +attribute vec2 a_pos; +attribute vec2 a_texture_pos; + +varying vec2 v_pos; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); + + highp vec2 epsilon = 1.0 / u_dimension; + float scale = (u_dimension.x - 2.0) / u_dimension.x; + v_pos = (a_texture_pos / 8192.0) * scale + epsilon; +} + +*/ + +// Uncompressed source of hillshade_prepare.fragment.glsl: +/* +#ifdef GL_ES +precision highp float; +#endif + +uniform sampler2D u_image; +varying vec2 v_pos; +uniform vec2 u_dimension; +uniform float u_zoom; +uniform float u_maxzoom; + +float getElevation(vec2 coord, float bias) { + // Convert encoded elevation value to meters + vec4 data = texture2D(u_image, coord) * 255.0; + return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0; +} + +void main() { + vec2 epsilon = 1.0 / u_dimension; + + // queried pixels: + // +-----------+ + // | | | | + // | a | b | c | + // | | | | + // +-----------+ + // | | | | + // | d | e | f | + // | | | | + // +-----------+ + // | | | | + // | g | h | i | + // | | | | + // +-----------+ + + float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0); + float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0); + float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0); + float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0); + float e = getElevation(v_pos, 0.0); + float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0); + float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0); + float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0); + float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0); + + // here we divide the x and y slopes by 8 * pixel size + // where pixel size (aka meters/pixel) is: + // circumference of the world / (pixels per tile * number of tiles) + // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom)) + // which can be reduced to: pow(2, 19.25619978527 - u_zoom) + // we want to vertically exaggerate the hillshading though, because otherwise + // it is barely noticeable at low zooms. to do this, we multiply this by some + // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value + // Here we use a=0.3 which works out to the expression below. see + // nickidlugash's awesome breakdown for more info + // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556 + float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3; + + vec2 deriv = vec2( + (c + f + f + i) - (a + d + d + g), + (g + h + h + i) - (a + b + b + c) + ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom); + + gl_FragColor = clamp(vec4( + deriv.x / 2.0 + 0.5, + deriv.y / 2.0 + 0.5, + 1.0, + 1.0), 0.0, 1.0); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/line.cpp b/src/mbgl/programs/gl/line.cpp new file mode 100644 index 0000000000..c25679ae1f --- /dev/null +++ b/src/mbgl/programs/gl/line.cpp @@ -0,0 +1,253 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "line", + programs::gl::shaderSource() + 30585, programs::gl::shaderSource() + 33509); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of line.vertex.glsl: +/* + + +// the distance over which the line edge fades out. +// Retina devices need a smaller distance to avoid aliasing. +#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 + +// floor(127 / 2) == 63.0 +// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is +// stored in a byte (-128..127). we scale regular normals up to length 63, but +// there are also "special" normals that have a bigger length (of up to 126 in +// this case). +// #define scale 63.0 +#define scale 0.015873016 + +attribute vec4 a_pos_normal; +attribute vec4 a_data; + +uniform mat4 u_matrix; +uniform mediump float u_ratio; +uniform vec2 u_gl_units_to_pixels; + +varying vec2 v_normal; +varying vec2 v_width2; +varying float v_gamma_scale; +varying highp float v_linesofar; + + +#ifndef HAS_UNIFORM_u_color +uniform lowp float a_color_t; +attribute highp vec4 a_color; +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_blur +uniform lowp float a_blur_t; +attribute lowp vec2 a_blur; +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth +uniform lowp float a_gapwidth_t; +attribute mediump vec2 a_gapwidth; +#else +uniform mediump float u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_offset +uniform lowp float a_offset_t; +attribute lowp vec2 a_offset; +#else +uniform lowp float u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_width +uniform lowp float a_width_t; +attribute mediump vec2 a_width; +#else +uniform mediump float u_width; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_color + color = unpack_mix_color(a_color, a_color_t); +#else + highp vec4 color = u_color; +#endif + + +#ifndef HAS_UNIFORM_u_blur + blur = unpack_mix_vec2(a_blur, a_blur_t); +#else + lowp float blur = u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth + mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); +#else + mediump float gapwidth = u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_offset + lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); +#else + lowp float offset = u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_width + mediump float width = unpack_mix_vec2(a_width, a_width_t); +#else + mediump float width = u_width; +#endif + + + vec2 a_extrude = a_data.xy - 128.0; + float a_direction = mod(a_data.z, 4.0) - 1.0; + + v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0; + + vec2 pos = a_pos_normal.xy; + + // x is 1 if it's a round cap, 0 otherwise + // y is 1 if the normal points up, and -1 if it points down + mediump vec2 normal = a_pos_normal.zw; + v_normal = normal; + + // these transformations used to be applied in the JS and native code bases. + // moved them into the shader for clarity and simplicity. + gapwidth = gapwidth / 2.0; + float halfwidth = width / 2.0; + offset = -1.0 * offset; + + float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); + + // Scale the extrusion vector down to a normal and then up by the line width + // of this vertex. + mediump vec2 dist = outset * a_extrude * scale; + + // Calculate the offset when drawing a line that is to the side of the actual line. + // We do this by creating a vector that points towards the extrude, but rotate + // it when we're drawing round end points (a_direction = -1 or 1) since their + // extrude vector points in another direction. + mediump float u = 0.5 * a_direction; + mediump float t = 1.0 - abs(u); + mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); + + vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); + gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; + + // calculate how much the perspective view squishes or stretches the extrude + float extrude_length_without_perspective = length(dist); + float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); + v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; + + v_width2 = vec2(outset, inset); +} + +*/ + +// Uncompressed source of line.fragment.glsl: +/* + +#ifndef HAS_UNIFORM_u_color +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_blur +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +varying vec2 v_width2; +varying vec2 v_normal; +varying float v_gamma_scale; + +void main() { + +#ifdef HAS_UNIFORM_u_color + highp vec4 color = u_color; +#endif + + +#ifdef HAS_UNIFORM_u_blur + lowp float blur = u_blur; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + + // Calculate the distance of the pixel from the line in pixels. + float dist = length(v_normal) * v_width2.s; + + // Calculate the antialiasing fade factor. This is either when fading in + // the line in case of an offset line (v_width2.t) or when fading out + // (v_width2.s) + float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; + float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); + + gl_FragColor = color * (alpha * opacity); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/line_gradient.cpp b/src/mbgl/programs/gl/line_gradient.cpp new file mode 100644 index 0000000000..fae94b4596 --- /dev/null +++ b/src/mbgl/programs/gl/line_gradient.cpp @@ -0,0 +1,235 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "line_gradient", + programs::gl::shaderSource() + 34335, programs::gl::shaderSource() + 37054); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of line_gradient.vertex.glsl: +/* + +// the attribute conveying progress along a line is scaled to [0, 2^15) +#define MAX_LINE_DISTANCE 32767.0 + +// the distance over which the line edge fades out. +// Retina devices need a smaller distance to avoid aliasing. +#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 + +// floor(127 / 2) == 63.0 +// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is +// stored in a byte (-128..127). we scale regular normals up to length 63, but +// there are also "special" normals that have a bigger length (of up to 126 in +// this case). +// #define scale 63.0 +#define scale 0.015873016 + +attribute vec4 a_pos_normal; +attribute vec4 a_data; + +uniform mat4 u_matrix; +uniform mediump float u_ratio; +uniform vec2 u_gl_units_to_pixels; + +varying vec2 v_normal; +varying vec2 v_width2; +varying float v_gamma_scale; +varying highp float v_lineprogress; + + +#ifndef HAS_UNIFORM_u_blur +uniform lowp float a_blur_t; +attribute lowp vec2 a_blur; +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth +uniform lowp float a_gapwidth_t; +attribute mediump vec2 a_gapwidth; +#else +uniform mediump float u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_offset +uniform lowp float a_offset_t; +attribute lowp vec2 a_offset; +#else +uniform lowp float u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_width +uniform lowp float a_width_t; +attribute mediump vec2 a_width; +#else +uniform mediump float u_width; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_blur + blur = unpack_mix_vec2(a_blur, a_blur_t); +#else + lowp float blur = u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth + mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); +#else + mediump float gapwidth = u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_offset + lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); +#else + lowp float offset = u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_width + mediump float width = unpack_mix_vec2(a_width, a_width_t); +#else + mediump float width = u_width; +#endif + + + vec2 a_extrude = a_data.xy - 128.0; + float a_direction = mod(a_data.z, 4.0) - 1.0; + + v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE; + + vec2 pos = a_pos_normal.xy; + + // x is 1 if it's a round cap, 0 otherwise + // y is 1 if the normal points up, and -1 if it points down + mediump vec2 normal = a_pos_normal.zw; + v_normal = normal; + + // these transformations used to be applied in the JS and native code bases. + // moved them into the shader for clarity and simplicity. + gapwidth = gapwidth / 2.0; + float halfwidth = width / 2.0; + offset = -1.0 * offset; + + float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); + + // Scale the extrusion vector down to a normal and then up by the line width + // of this vertex. + mediump vec2 dist = outset * a_extrude * scale; + + // Calculate the offset when drawing a line that is to the side of the actual line. + // We do this by creating a vector that points towards the extrude, but rotate + // it when we're drawing round end points (a_direction = -1 or 1) since their + // extrude vector points in another direction. + mediump float u = 0.5 * a_direction; + mediump float t = 1.0 - abs(u); + mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); + + vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); + gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; + + // calculate how much the perspective view squishes or stretches the extrude + float extrude_length_without_perspective = length(dist); + float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); + v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; + + v_width2 = vec2(outset, inset); +} + +*/ + +// Uncompressed source of line_gradient.fragment.glsl: +/* + + +#ifndef HAS_UNIFORM_u_blur +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +uniform sampler2D u_image; + +varying vec2 v_width2; +varying vec2 v_normal; +varying float v_gamma_scale; +varying highp float v_lineprogress; + +void main() { + +#ifdef HAS_UNIFORM_u_blur + lowp float blur = u_blur; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + + // Calculate the distance of the pixel from the line in pixels. + float dist = length(v_normal) * v_width2.s; + + // Calculate the antialiasing fade factor. This is either when fading in + // the line in case of an offset line (v_width2.t) or when fading out + // (v_width2.s) + float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; + float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); + + // For gradient lines, v_lineprogress is the ratio along the entire line, + // scaled to [0, 2^15), and the gradient ramp is stored in a texture. + vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5)); + + gl_FragColor = color * (alpha * opacity); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/line_pattern.cpp b/src/mbgl/programs/gl/line_pattern.cpp new file mode 100644 index 0000000000..2e9ebaf5ea --- /dev/null +++ b/src/mbgl/programs/gl/line_pattern.cpp @@ -0,0 +1,322 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "line_pattern", + programs::gl::shaderSource() + 37841, programs::gl::shaderSource() + 41162); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of line_pattern.vertex.glsl: +/* +// floor(127 / 2) == 63.0 +// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is +// stored in a byte (-128..127). we scale regular normals up to length 63, but +// there are also "special" normals that have a bigger length (of up to 126 in +// this case). +// #define scale 63.0 +#define scale 0.015873016 + +// We scale the distance before adding it to the buffers so that we can store +// long distances for long segments. Use this value to unscale the distance. +#define LINE_DISTANCE_SCALE 2.0 + +// the distance over which the line edge fades out. +// Retina devices need a smaller distance to avoid aliasing. +#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 + +attribute vec4 a_pos_normal; +attribute vec4 a_data; + +uniform mat4 u_matrix; +uniform vec2 u_gl_units_to_pixels; +uniform mediump float u_ratio; + +varying vec2 v_normal; +varying vec2 v_width2; +varying float v_linesofar; +varying float v_gamma_scale; + + +#ifndef HAS_UNIFORM_u_blur +uniform lowp float a_blur_t; +attribute lowp vec2 a_blur; +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_offset +uniform lowp float a_offset_t; +attribute lowp vec2 a_offset; +#else +uniform lowp float u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth +uniform lowp float a_gapwidth_t; +attribute mediump vec2 a_gapwidth; +#else +uniform mediump float u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_width +uniform lowp float a_width_t; +attribute mediump vec2 a_width; +#else +uniform mediump float u_width; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from +uniform lowp float a_pattern_from_t; +attribute lowp vec4 a_pattern_from; +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +uniform lowp float a_pattern_to_t; +attribute lowp vec4 a_pattern_to; +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_blur + blur = unpack_mix_vec2(a_blur, a_blur_t); +#else + lowp float blur = u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_offset + lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); +#else + lowp float offset = u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth + mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); +#else + mediump float gapwidth = u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_width + mediump float width = unpack_mix_vec2(a_width, a_width_t); +#else + mediump float width = u_width; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_from + pattern_from = a_pattern_from; +#else + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to + pattern_to = a_pattern_to; +#else + mediump vec4 pattern_to = u_pattern_to; +#endif + + + vec2 a_extrude = a_data.xy - 128.0; + float a_direction = mod(a_data.z, 4.0) - 1.0; + float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE; + // float tileRatio = u_scale.y; + vec2 pos = a_pos_normal.xy; + + // x is 1 if it's a round cap, 0 otherwise + // y is 1 if the normal points up, and -1 if it points down + mediump vec2 normal = a_pos_normal.zw; + v_normal = normal; + + // these transformations used to be applied in the JS and native code bases. + // moved them into the shader for clarity and simplicity. + gapwidth = gapwidth / 2.0; + float halfwidth = width / 2.0; + offset = -1.0 * offset; + + float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); + + // Scale the extrusion vector down to a normal and then up by the line width + // of this vertex. + mediump vec2 dist = outset * a_extrude * scale; + + // Calculate the offset when drawing a line that is to the side of the actual line. + // We do this by creating a vector that points towards the extrude, but rotate + // it when we're drawing round end points (a_direction = -1 or 1) since their + // extrude vector points in another direction. + mediump float u = 0.5 * a_direction; + mediump float t = 1.0 - abs(u); + mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); + + vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); + gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; + + // calculate how much the perspective view squishes or stretches the extrude + float extrude_length_without_perspective = length(dist); + float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); + v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; + + v_linesofar = a_linesofar; + v_width2 = vec2(outset, inset); +} + +*/ + +// Uncompressed source of line_pattern.fragment.glsl: +/* +uniform vec2 u_texsize; +uniform float u_fade; +uniform mediump vec4 u_scale; + +uniform sampler2D u_image; + +varying vec2 v_normal; +varying vec2 v_width2; +varying float v_linesofar; +varying float v_gamma_scale; + + +#ifndef HAS_UNIFORM_u_pattern_from +varying lowp vec4 pattern_from; +#else +uniform lowp vec4 u_pattern_from; +#endif + + +#ifndef HAS_UNIFORM_u_pattern_to +varying lowp vec4 pattern_to; +#else +uniform lowp vec4 u_pattern_to; +#endif + + +#ifndef HAS_UNIFORM_u_blur +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +void main() { + +#ifdef HAS_UNIFORM_u_pattern_from + mediump vec4 pattern_from = u_pattern_from; +#endif + + +#ifdef HAS_UNIFORM_u_pattern_to + mediump vec4 pattern_to = u_pattern_to; +#endif + + + +#ifdef HAS_UNIFORM_u_blur + lowp float blur = u_blur; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + + vec2 pattern_tl_a = pattern_from.xy; + vec2 pattern_br_a = pattern_from.zw; + vec2 pattern_tl_b = pattern_to.xy; + vec2 pattern_br_b = pattern_to.zw; + + float pixelRatio = u_scale.x; + float tileZoomRatio = u_scale.y; + float fromScale = u_scale.z; + float toScale = u_scale.w; + + vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); + vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); + + vec2 pattern_size_a = vec2(display_size_a.x * fromScale / tileZoomRatio, display_size_a.y); + vec2 pattern_size_b = vec2(display_size_b.x * toScale / tileZoomRatio, display_size_b.y); + + // Calculate the distance of the pixel from the line in pixels. + float dist = length(v_normal) * v_width2.s; + + // Calculate the antialiasing fade factor. This is either when fading in + // the line in case of an offset line (v_width2.t) or when fading out + // (v_width2.s) + float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; + float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); + + float x_a = mod(v_linesofar / pattern_size_a.x, 1.0); + float x_b = mod(v_linesofar / pattern_size_b.x, 1.0); + + // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge + // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0) + // to ensure we don't sample outside the designated symbol on the sprite sheet. + // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of + // the texture coordinate + float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_a.y + 2.0) / 2.0) / pattern_size_a.y); + float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_b.y + 2.0) / 2.0) / pattern_size_b.y); + vec2 pos_a = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, vec2(x_a, y_a)); + vec2 pos_b = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, vec2(x_b, y_b)); + + vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade); + + gl_FragColor = color * alpha * opacity; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/line_sdf.cpp b/src/mbgl/programs/gl/line_sdf.cpp new file mode 100644 index 0000000000..0886bfcdf0 --- /dev/null +++ b/src/mbgl/programs/gl/line_sdf.cpp @@ -0,0 +1,315 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "line_sdf", + programs::gl::shaderSource() + 43475, programs::gl::shaderSource() + 47089); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of line_sdf.vertex.glsl: +/* +// floor(127 / 2) == 63.0 +// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is +// stored in a byte (-128..127). we scale regular normals up to length 63, but +// there are also "special" normals that have a bigger length (of up to 126 in +// this case). +// #define scale 63.0 +#define scale 0.015873016 + +// We scale the distance before adding it to the buffers so that we can store +// long distances for long segments. Use this value to unscale the distance. +#define LINE_DISTANCE_SCALE 2.0 + +// the distance over which the line edge fades out. +// Retina devices need a smaller distance to avoid aliasing. +#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 + +attribute vec4 a_pos_normal; +attribute vec4 a_data; + +uniform mat4 u_matrix; +uniform mediump float u_ratio; +uniform vec2 u_patternscale_a; +uniform float u_tex_y_a; +uniform vec2 u_patternscale_b; +uniform float u_tex_y_b; +uniform vec2 u_gl_units_to_pixels; + +varying vec2 v_normal; +varying vec2 v_width2; +varying vec2 v_tex_a; +varying vec2 v_tex_b; +varying float v_gamma_scale; + + +#ifndef HAS_UNIFORM_u_color +uniform lowp float a_color_t; +attribute highp vec4 a_color; +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_blur +uniform lowp float a_blur_t; +attribute lowp vec2 a_blur; +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth +uniform lowp float a_gapwidth_t; +attribute mediump vec2 a_gapwidth; +#else +uniform mediump float u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_offset +uniform lowp float a_offset_t; +attribute lowp vec2 a_offset; +#else +uniform lowp float u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_width +uniform lowp float a_width_t; +attribute mediump vec2 a_width; +varying mediump float width; +#else +uniform mediump float u_width; +#endif + + +#ifndef HAS_UNIFORM_u_floorwidth +uniform lowp float a_floorwidth_t; +attribute lowp vec2 a_floorwidth; +varying lowp float floorwidth; +#else +uniform lowp float u_floorwidth; +#endif + + +void main() { + +#ifndef HAS_UNIFORM_u_color + color = unpack_mix_color(a_color, a_color_t); +#else + highp vec4 color = u_color; +#endif + + +#ifndef HAS_UNIFORM_u_blur + blur = unpack_mix_vec2(a_blur, a_blur_t); +#else + lowp float blur = u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_gapwidth + mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); +#else + mediump float gapwidth = u_gapwidth; +#endif + + +#ifndef HAS_UNIFORM_u_offset + lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); +#else + lowp float offset = u_offset; +#endif + + +#ifndef HAS_UNIFORM_u_width + width = unpack_mix_vec2(a_width, a_width_t); +#else + mediump float width = u_width; +#endif + + +#ifndef HAS_UNIFORM_u_floorwidth + floorwidth = unpack_mix_vec2(a_floorwidth, a_floorwidth_t); +#else + lowp float floorwidth = u_floorwidth; +#endif + + + vec2 a_extrude = a_data.xy - 128.0; + float a_direction = mod(a_data.z, 4.0) - 1.0; + float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE; + + vec2 pos = a_pos_normal.xy; + + // x is 1 if it's a round cap, 0 otherwise + // y is 1 if the normal points up, and -1 if it points down + mediump vec2 normal = a_pos_normal.zw; + v_normal = normal; + + // these transformations used to be applied in the JS and native code bases. + // moved them into the shader for clarity and simplicity. + gapwidth = gapwidth / 2.0; + float halfwidth = width / 2.0; + offset = -1.0 * offset; + + float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); + float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); + + // Scale the extrusion vector down to a normal and then up by the line width + // of this vertex. + mediump vec2 dist =outset * a_extrude * scale; + + // Calculate the offset when drawing a line that is to the side of the actual line. + // We do this by creating a vector that points towards the extrude, but rotate + // it when we're drawing round end points (a_direction = -1 or 1) since their + // extrude vector points in another direction. + mediump float u = 0.5 * a_direction; + mediump float t = 1.0 - abs(u); + mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); + + vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); + gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; + + // calculate how much the perspective view squishes or stretches the extrude + float extrude_length_without_perspective = length(dist); + float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); + v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; + + v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a); + v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b); + + v_width2 = vec2(outset, inset); +} + +*/ + +// Uncompressed source of line_sdf.fragment.glsl: +/* + +uniform sampler2D u_image; +uniform float u_sdfgamma; +uniform float u_mix; + +varying vec2 v_normal; +varying vec2 v_width2; +varying vec2 v_tex_a; +varying vec2 v_tex_b; +varying float v_gamma_scale; + + +#ifndef HAS_UNIFORM_u_color +varying highp vec4 color; +#else +uniform highp vec4 u_color; +#endif + + +#ifndef HAS_UNIFORM_u_blur +varying lowp float blur; +#else +uniform lowp float u_blur; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_width +varying mediump float width; +#else +uniform mediump float u_width; +#endif + + +#ifndef HAS_UNIFORM_u_floorwidth +varying lowp float floorwidth; +#else +uniform lowp float u_floorwidth; +#endif + + +void main() { + +#ifdef HAS_UNIFORM_u_color + highp vec4 color = u_color; +#endif + + +#ifdef HAS_UNIFORM_u_blur + lowp float blur = u_blur; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + +#ifdef HAS_UNIFORM_u_width + mediump float width = u_width; +#endif + + +#ifdef HAS_UNIFORM_u_floorwidth + lowp float floorwidth = u_floorwidth; +#endif + + + // Calculate the distance of the pixel from the line in pixels. + float dist = length(v_normal) * v_width2.s; + + // Calculate the antialiasing fade factor. This is either when fading in + // the line in case of an offset line (v_width2.t) or when fading out + // (v_width2.s) + float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; + float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); + + float sdfdist_a = texture2D(u_image, v_tex_a).a; + float sdfdist_b = texture2D(u_image, v_tex_b).a; + float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix); + alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist); + + gl_FragColor = color * (alpha * opacity); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/preludes.cpp b/src/mbgl/programs/gl/preludes.cpp new file mode 100644 index 0000000000..6c895c0d36 --- /dev/null +++ b/src/mbgl/programs/gl/preludes.cpp @@ -0,0 +1,15 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include + +namespace mbgl { +namespace programs { +namespace gl { + +const char* vertexShaderPrelude = programs::gl::shaderSource() + 0; +const char* fragmentShaderPrelude = programs::gl::shaderSource() + 1252; + +} // namespace gl +} // namespace programs +} // namespace mbgl diff --git a/src/mbgl/programs/gl/preludes.hpp b/src/mbgl/programs/gl/preludes.hpp new file mode 100644 index 0000000000..6d86ee45c5 --- /dev/null +++ b/src/mbgl/programs/gl/preludes.hpp @@ -0,0 +1,14 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#pragma once + +namespace mbgl { +namespace programs { +namespace gl { + +extern const char* vertexShaderPrelude; +extern const char* fragmentShaderPrelude; + +} // namespace gl +} // namespace programs +} // namespace mbgl diff --git a/src/mbgl/programs/gl/raster.cpp b/src/mbgl/programs/gl/raster.cpp new file mode 100644 index 0000000000..512dc81a30 --- /dev/null +++ b/src/mbgl/programs/gl/raster.cpp @@ -0,0 +1,103 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "raster", + programs::gl::shaderSource() + 48592, programs::gl::shaderSource() + 48941); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of raster.vertex.glsl: +/* +uniform mat4 u_matrix; +uniform vec2 u_tl_parent; +uniform float u_scale_parent; +uniform float u_buffer_scale; + +attribute vec2 a_pos; +attribute vec2 a_texture_pos; + +varying vec2 v_pos0; +varying vec2 v_pos1; + +void main() { + gl_Position = u_matrix * vec4(a_pos, 0, 1); + // We are using Int16 for texture position coordinates to give us enough precision for + // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer + // as an arbitrarily high number to preserve adequate precision when rendering. + // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates, + // so math for modifying either is consistent. + v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5; + v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent; +} + +*/ + +// Uncompressed source of raster.fragment.glsl: +/* +uniform float u_fade_t; +uniform float u_opacity; +uniform sampler2D u_image0; +uniform sampler2D u_image1; +varying vec2 v_pos0; +varying vec2 v_pos1; + +uniform float u_brightness_low; +uniform float u_brightness_high; + +uniform float u_saturation_factor; +uniform float u_contrast_factor; +uniform vec3 u_spin_weights; + +void main() { + + // read and cross-fade colors from the main and parent tiles + vec4 color0 = texture2D(u_image0, v_pos0); + vec4 color1 = texture2D(u_image1, v_pos1); + if (color0.a > 0.0) { + color0.rgb = color0.rgb / color0.a; + } + if (color1.a > 0.0) { + color1.rgb = color1.rgb / color1.a; + } + vec4 color = mix(color0, color1, u_fade_t); + color.a *= u_opacity; + vec3 rgb = color.rgb; + + // spin + rgb = vec3( + dot(rgb, u_spin_weights.xyz), + dot(rgb, u_spin_weights.zxy), + dot(rgb, u_spin_weights.yzx)); + + // saturation + float average = (color.r + color.g + color.b) / 3.0; + rgb += (average - rgb) * u_saturation_factor; + + // contrast + rgb = (rgb - 0.5) * u_contrast_factor + 0.5; + + // brightness + vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low); + vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high); + + gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/shader_source.cpp b/src/mbgl/programs/gl/shader_source.cpp new file mode 100644 index 0000000000..4a986403f7 --- /dev/null +++ b/src/mbgl/programs/gl/shader_source.cpp @@ -0,0 +1,471 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include + +#include + +namespace mbgl { +namespace programs { +namespace gl { + +constexpr const uint8_t compressedShaderSource[] = { + 0x78, 0xda, 0xed, 0x3d, 0xfd, 0x6f, 0xe3, 0x36, 0xb2, 0xf7, 0x73, 0xfe, 0x0a, 0x17, 0x05, 0x0e, + 0x92, 0x2c, 0x5b, 0xb6, 0x93, 0xec, 0x97, 0x4e, 0xaf, 0x08, 0x76, 0xb3, 0x7d, 0x01, 0xda, 0xdd, + 0x60, 0xd3, 0xf6, 0x15, 0x57, 0x2c, 0x0c, 0xc9, 0x56, 0x6c, 0xdf, 0xd9, 0x96, 0x9f, 0xad, 0x24, + 0x76, 0x0e, 0xf9, 0xdf, 0x1f, 0x87, 0xdf, 0xa4, 0x48, 0x59, 0x76, 0x12, 0xe7, 0xe3, 0x19, 0x45, + 0x37, 0x16, 0x39, 0x1c, 0x0e, 0xc9, 0xe1, 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, 0x76, 0x65, 0xa9, 0x92, 0x16, 0x56, 0x03, 0x61, + 0xf3, 0x18, 0xad, 0xbe, 0x0b, 0x33, 0x65, 0x24, 0x4f, 0x21, 0x8d, 0xa9, 0x01, 0xb4, 0xc5, 0x04, + 0x82, 0x53, 0xa7, 0x28, 0x09, 0x35, 0x9a, 0xa9, 0x51, 0xa8, 0xc2, 0x30, 0x02, 0xd6, 0x50, 0x99, + 0x8c, 0xaf, 0x2c, 0xbd, 0x07, 0x39, 0x0a, 0x85, 0x38, 0x97, 0x92, 0x07, 0x99, 0x9c, 0x38, 0xa9, + 0x18, 0x4e, 0xd7, 0xe8, 0x92, 0xb2, 0x49, 0x7d, 0x6b, 0x48, 0xa2, 0x1c, 0x6e, 0xa6, 0x8a, 0x66, + 0x5a, 0x09, 0xe3, 0xea, 0x42, 0x91, 0x36, 0x31, 0x73, 0xec, 0xe4, 0x49, 0x30, 0x25, 0x14, 0x2e, + 0xf2, 0x79, 0xf6, 0xef, 0xb4, 0x8c, 0xf5, 0x64, 0x08, 0x3b, 0x07, 0xca, 0x50, 0x26, 0x46, 0x54, + 0xf2, 0xcb, 0xf8, 0x51, 0x07, 0x5c, 0x4f, 0xfb, 0xcd, 0xa8, 0x9f, 0x0f, 0x4b, 0x69, 0xc7, 0x10, + 0x65, 0x2c, 0x2a, 0xc3, 0x59, 0x18, 0x55, 0x01, 0x59, 0xc3, 0xae, 0x3a, 0xec, 0xfa, 0x36, 0x94, + 0x32, 0x8a, 0x0a, 0x63, 0xe5, 0x17, 0x15, 0xcc, 0xc4, 0x36, 0x1a, 0x44, 0x19, 0xf7, 0x14, 0x41, + 0x89, 0xbb, 0x40, 0x2c, 0x90, 0x87, 0x68, 0x81, 0xec, 0xc7, 0x79, 0x2c, 0xad, 0x8f, 0xf0, 0x0b, + 0xad, 0x91, 0xa5, 0xe2, 0xad, 0x47, 0x14, 0x5d, 0xdd, 0xc4, 0xa4, 0x32, 0xcc, 0xe7, 0xa2, 0xce, + 0x65, 0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0xc8, 0x41, 0xd0, 0x35, 0x24, 0x99, 0xd9, 0x3b, 0x08, 0x16, 0xf8, 0xd9, 0x28, 0xef, 0x0d, + 0x75, 0x5a, 0xe7, 0x59, 0x1e, 0xe7, 0x69, 0x77, 0xb1, 0x9a, 0x24, 0xd9, 0xd8, 0x52, 0x90, 0x84, + 0x98, 0xd3, 0x76, 0x93, 0x14, 0x21, 0xde, 0x1b, 0xe2, 0x08, 0x8c, 0x2f, 0x60, 0xf7, 0x60, 0xcd, + 0x06, 0x1a, 0x49, 0x1d, 0xc7, 0x49, 0x8a, 0x16, 0xae, 0x71, 0x3c, 0x4d, 0x2d, 0x10, 0x03, 0xf6, + 0x7a, 0x83, 0x96, 0x2d, 0x38, 0x00, 0x44, 0xb0, 0x9e, 0x8c, 0x47, 0x80, 0x98, 0xcb, 0x93, 0x78, + 0x16, 0x5a, 0x8e, 0x5c, 0x15, 0x4d, 0xbb, 0x82, 0x61, 0xa7, 0xb0, 0xe8, 0x33, 0x79, 0x79, 0x5c, + 0xe8, 0x31, 0x91, 0x3c, 0x2b, 0xf9, 0x49, 0x13, 0xe6, 0x1d, 0x55, 0x73, 0xd9, 0x39, 0x15, 0xac, + 0x79, 0x08, 0x0f, 0x20, 0x4b, 0x84, 0x0e, 0x61, 0xa9, 0x08, 0x54, 0xe6, 0xcb, 0x45, 0x3a, 0x98, + 0x40, 0xb0, 0x41, 0xc4, 0x79, 0xe3, 0x34, 0x6a, 0x68, 0xf3, 0xfa, 0xaf, 0xce, 0x77, 0xa6, 0xa8, + 0x42, 0x9f, 0xc2, 0x02, 0xf6, 0x83, 0x65, 0xfa, 0xc2, 0x3b, 0x23, 0x3f, 0xd8, 0x67, 0x2d, 0xea, + 0x54, 0x4c, 0x05, 0x88, 0x41, 0x42, 0xd0, 0x5f, 0xad, 0xef, 0x3e, 0xfd, 0xd5, 0xfe, 0xee, 0xb3, + 0x09, 0xec, 0x06, 0x38, 0x6e, 0x71, 0x78, 0x57, 0x83, 0x3e, 0xab, 0x41, 0x8d, 0xf7, 0xab, 0x90, + 0x57, 0x56, 0x44, 0x5c, 0xd6, 0x94, 0xf5, 0x88, 0xa9, 0x54, 0xa1, 0xf8, 0xd4, 0x34, 0xd5, 0x57, + 0x76, 0x9e, 0x8d, 0xa6, 0xf9, 0xba, 0x10, 0xda, 0x34, 0x12, 0x32, 0x97, 0x46, 0x48, 0x04, 0x0d, + 0x33, 0x21, 0x8d, 0x22, 0x15, 0x5b, 0x53, 0x1d, 0x45, 0x06, 0x45, 0xa4, 0x4b, 0xa4, 0xcf, 0x91, + 0xda, 0x4f, 0x07, 0x56, 0xc4, 0x41, 0x89, 0x08, 0xac, 0x7d, 0x38, 0x28, 0xc9, 0x0d, 0xac, 0x38, + 0x15, 0xda, 0x24, 0x97, 0x16, 0x25, 0x8f, 0x98, 0x65, 0x60, 0xa7, 0x80, 0x0b, 0x53, 0xa5, 0x1d, + 0x9b, 0x5e, 0xe0, 0x59, 0x0e, 0xa1, 0x27, 0xbd, 0xa8, 0x50, 0x9a, 0x9d, 0x8b, 0x42, 0x8a, 0x00, + 0x3b, 0xff, 0x44, 0xe5, 0x44, 0xed, 0x27, 0xcc, 0xa5, 0x41, 0xe7, 0x08, 0x7b, 0x59, 0xf1, 0x48, + 0x28, 0xac, 0x8e, 0xa5, 0x33, 0x91, 0xd5, 0xa0, 0xc9, 0xa3, 0x9a, 0x42, 0xc2, 0x5f, 0x8a, 0xf8, + 0x66, 0xba, 0x22, 0x99, 0x5a, 0xe7, 0x6b, 0x07, 0x91, 0xc4, 0x5e, 0x6e, 0xe3, 0x90, 0xd0, 0xfc, + 0x5d, 0x9e, 0x58, 0x1f, 0xaf, 0xe5, 0x2a, 0x28, 0x8c, 0x20, 0x86, 0x4c, 0x22, 0x53, 0x45, 0x00, + 0x6f, 0x4c, 0xbf, 0x09, 0xf5, 0x66, 0xe0, 0xf8, 0xb1, 0x0e, 0x9c, 0x9d, 0xc2, 0x07, 0xb4, 0xd4, + 0x85, 0xc6, 0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03, 0x90, 0xfe, 0x1c +}; + +const char* shaderSource() { + static std::string decompressed = util::decompress(std::string(reinterpret_cast(compressedShaderSource), sizeof(compressedShaderSource))); + return decompressed.c_str(); +}; + +} // namespace gl +} // namespace programs +} // namespace mbgl diff --git a/src/mbgl/programs/gl/shader_source.hpp b/src/mbgl/programs/gl/shader_source.hpp new file mode 100644 index 0000000000..f6de8a56cc --- /dev/null +++ b/src/mbgl/programs/gl/shader_source.hpp @@ -0,0 +1,13 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#pragma once + +namespace mbgl { +namespace programs { +namespace gl { + +const char* shaderSource(); + +} // namespace gl +} // namespace programs +} // namespace mbgl diff --git a/src/mbgl/programs/gl/shaders.cpp b/src/mbgl/programs/gl/shaders.cpp new file mode 100644 index 0000000000..3cc33992de --- /dev/null +++ b/src/mbgl/programs/gl/shaders.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +#include + +namespace mbgl { +namespace programs { +namespace gl { + +std::string fragmentSource(const ProgramParameters& parameters, const char* fragmentSource) { + return parameters.getDefines() + fragmentShaderPrelude + fragmentSource; +} + +std::string vertexSource(const ProgramParameters& parameters, const char* vertexSource) { + return parameters.getDefines() + vertexShaderPrelude + vertexSource; +} + +std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource) { + std::string result; + result.reserve((sizeof(size_t) * 2) * 2 + 2); // 2 size_t hex values + "v2" + result += util::toHex(std::hash()(vertexSource)); + result += util::toHex(std::hash()(fragmentSource)); + result += "v3"; + return result; +} + +} // namespace gl +} // namespace programs +} // namespace mbgl diff --git a/src/mbgl/programs/gl/shaders.hpp b/src/mbgl/programs/gl/shaders.hpp new file mode 100644 index 0000000000..5278ea54da --- /dev/null +++ b/src/mbgl/programs/gl/shaders.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace mbgl { + +class ProgramParameters; + +namespace programs { +namespace gl { + +std::string fragmentSource(const ProgramParameters&, const char* fragmentSource); +std::string vertexSource(const ProgramParameters&, const char* vertexSource); +std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource); + +} // namespace gl +} // namespace programs +} // namespace mbgl diff --git a/src/mbgl/programs/gl/symbol_icon.cpp b/src/mbgl/programs/gl/symbol_icon.cpp new file mode 100644 index 0000000000..733d3b7ebd --- /dev/null +++ b/src/mbgl/programs/gl/symbol_icon.cpp @@ -0,0 +1,162 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "symbol_icon", + programs::gl::shaderSource() + 50000, programs::gl::shaderSource() + 52654); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of symbol_icon.vertex.glsl: +/* +const float PI = 3.141592653589793; + +attribute vec4 a_pos_offset; +attribute vec4 a_data; +attribute vec3 a_projected_pos; +attribute float a_fade_opacity; + +uniform bool u_is_size_zoom_constant; +uniform bool u_is_size_feature_constant; +uniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function +uniform highp float u_size; // used when size is both zoom and feature constant +uniform highp float u_camera_to_center_distance; +uniform highp float u_pitch; +uniform bool u_rotate_symbol; +uniform highp float u_aspect_ratio; +uniform float u_fade_change; + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +uniform mat4 u_matrix; +uniform mat4 u_label_plane_matrix; +uniform mat4 u_gl_coord_matrix; + +uniform bool u_is_text; +uniform bool u_pitch_with_map; + +uniform vec2 u_texsize; + +varying vec2 v_tex; +varying float v_fade_opacity; + +void main() { + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + + vec2 a_pos = a_pos_offset.xy; + vec2 a_offset = a_pos_offset.zw; + + vec2 a_tex = a_data.xy; + vec2 a_size = a_data.zw; + + highp float segment_angle = -a_projected_pos[2]; + + float size; + if (!u_is_size_zoom_constant && !u_is_size_feature_constant) { + size = mix(a_size[0], a_size[1], u_size_t) / 256.0; + } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) { + size = a_size[0] / 256.0; + } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) { + size = u_size; + } else { + size = u_size; + } + + vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1); + highp float camera_to_anchor_distance = projectedPoint.w; + // See comments in symbol_sdf.vertex + highp float distance_ratio = u_pitch_with_map ? + camera_to_anchor_distance / u_camera_to_center_distance : + u_camera_to_center_distance / camera_to_anchor_distance; + highp float perspective_ratio = clamp( + 0.5 + 0.5 * distance_ratio, + 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles + 4.0); + + size *= perspective_ratio; + + float fontScale = u_is_text ? size / 24.0 : size; + + highp float symbol_rotation = 0.0; + if (u_rotate_symbol) { + // See comments in symbol_sdf.vertex + vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1); + + vec2 a = projectedPoint.xy / projectedPoint.w; + vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w; + + symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x); + } + + highp float angle_sin = sin(segment_angle + symbol_rotation); + highp float angle_cos = cos(segment_angle + symbol_rotation); + mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); + + vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); + gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); + + v_tex = a_tex / u_texsize; + vec2 fade_opacity = unpack_opacity(a_fade_opacity); + float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change; + v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change)); +} + +*/ + +// Uncompressed source of symbol_icon.fragment.glsl: +/* +uniform sampler2D u_texture; + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +varying vec2 v_tex; +varying float v_fade_opacity; + +void main() { + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + + lowp float alpha = opacity * v_fade_opacity; + gl_FragColor = texture2D(u_texture, v_tex) * alpha; + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/symbol_sdf_icon.cpp b/src/mbgl/programs/gl/symbol_sdf_icon.cpp new file mode 100644 index 0000000000..ef3ecd138c --- /dev/null +++ b/src/mbgl/programs/gl/symbol_sdf_icon.cpp @@ -0,0 +1,317 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "symbol_sdf_icon", + programs::gl::shaderSource() + 53059, programs::gl::shaderSource() + 57099); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of symbol_sdf_icon.vertex.glsl: +/* +const float PI = 3.141592653589793; + +attribute vec4 a_pos_offset; +attribute vec4 a_data; +attribute vec3 a_projected_pos; +attribute float a_fade_opacity; + +// contents of a_size vary based on the type of property value +// used for {text,icon}-size. +// For constants, a_size is disabled. +// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature. +// For composite functions: +// [ text-size(lowerZoomStop, feature), +// text-size(upperZoomStop, feature) ] +uniform bool u_is_size_zoom_constant; +uniform bool u_is_size_feature_constant; +uniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function +uniform highp float u_size; // used when size is both zoom and feature constant + + +#ifndef HAS_UNIFORM_u_fill_color +uniform lowp float a_fill_color_t; +attribute highp vec4 a_fill_color; +varying highp vec4 fill_color; +#else +uniform highp vec4 u_fill_color; +#endif + + +#ifndef HAS_UNIFORM_u_halo_color +uniform lowp float a_halo_color_t; +attribute highp vec4 a_halo_color; +varying highp vec4 halo_color; +#else +uniform highp vec4 u_halo_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_halo_width +uniform lowp float a_halo_width_t; +attribute lowp vec2 a_halo_width; +varying lowp float halo_width; +#else +uniform lowp float u_halo_width; +#endif + + +#ifndef HAS_UNIFORM_u_halo_blur +uniform lowp float a_halo_blur_t; +attribute lowp vec2 a_halo_blur; +varying lowp float halo_blur; +#else +uniform lowp float u_halo_blur; +#endif + + +uniform mat4 u_matrix; +uniform mat4 u_label_plane_matrix; +uniform mat4 u_gl_coord_matrix; + +uniform bool u_is_text; +uniform bool u_pitch_with_map; +uniform highp float u_pitch; +uniform bool u_rotate_symbol; +uniform highp float u_aspect_ratio; +uniform highp float u_camera_to_center_distance; +uniform float u_fade_change; + +uniform vec2 u_texsize; + +varying vec2 v_data0; +varying vec3 v_data1; + +void main() { + +#ifndef HAS_UNIFORM_u_fill_color + fill_color = unpack_mix_color(a_fill_color, a_fill_color_t); +#else + highp vec4 fill_color = u_fill_color; +#endif + + +#ifndef HAS_UNIFORM_u_halo_color + halo_color = unpack_mix_color(a_halo_color, a_halo_color_t); +#else + highp vec4 halo_color = u_halo_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_halo_width + halo_width = unpack_mix_vec2(a_halo_width, a_halo_width_t); +#else + lowp float halo_width = u_halo_width; +#endif + + +#ifndef HAS_UNIFORM_u_halo_blur + halo_blur = unpack_mix_vec2(a_halo_blur, a_halo_blur_t); +#else + lowp float halo_blur = u_halo_blur; +#endif + + + vec2 a_pos = a_pos_offset.xy; + vec2 a_offset = a_pos_offset.zw; + + vec2 a_tex = a_data.xy; + vec2 a_size = a_data.zw; + + highp float segment_angle = -a_projected_pos[2]; + float size; + + if (!u_is_size_zoom_constant && !u_is_size_feature_constant) { + size = mix(a_size[0], a_size[1], u_size_t) / 256.0; + } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) { + size = a_size[0] / 256.0; + } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) { + size = u_size; + } else { + size = u_size; + } + + vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1); + highp float camera_to_anchor_distance = projectedPoint.w; + // If the label is pitched with the map, layout is done in pitched space, + // which makes labels in the distance smaller relative to viewport space. + // We counteract part of that effect by multiplying by the perspective ratio. + // If the label isn't pitched with the map, we do layout in viewport space, + // which makes labels in the distance larger relative to the features around + // them. We counteract part of that effect by dividing by the perspective ratio. + highp float distance_ratio = u_pitch_with_map ? + camera_to_anchor_distance / u_camera_to_center_distance : + u_camera_to_center_distance / camera_to_anchor_distance; + highp float perspective_ratio = clamp( + 0.5 + 0.5 * distance_ratio, + 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles + 4.0); + + size *= perspective_ratio; + + float fontScale = u_is_text ? size / 24.0 : size; + + highp float symbol_rotation = 0.0; + if (u_rotate_symbol) { + // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units + // To figure out that angle in projected space, we draw a short horizontal line in tile + // space, project it, and measure its angle in projected space. + vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1); + + vec2 a = projectedPoint.xy / projectedPoint.w; + vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w; + + symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x); + } + + highp float angle_sin = sin(segment_angle + symbol_rotation); + highp float angle_cos = cos(segment_angle + symbol_rotation); + mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); + + vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); + gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); + float gamma_scale = gl_Position.w; + + vec2 tex = a_tex / u_texsize; + vec2 fade_opacity = unpack_opacity(a_fade_opacity); + float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change; + float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change)); + + v_data0 = vec2(tex.x, tex.y); + v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity); +} + +*/ + +// Uncompressed source of symbol_sdf_icon.fragment.glsl: +/* +#define SDF_PX 8.0 +#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO + +uniform bool u_is_halo; + +#ifndef HAS_UNIFORM_u_fill_color +varying highp vec4 fill_color; +#else +uniform highp vec4 u_fill_color; +#endif + + +#ifndef HAS_UNIFORM_u_halo_color +varying highp vec4 halo_color; +#else +uniform highp vec4 u_halo_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_halo_width +varying lowp float halo_width; +#else +uniform lowp float u_halo_width; +#endif + + +#ifndef HAS_UNIFORM_u_halo_blur +varying lowp float halo_blur; +#else +uniform lowp float u_halo_blur; +#endif + + +uniform sampler2D u_texture; +uniform highp float u_gamma_scale; +uniform bool u_is_text; + +varying vec2 v_data0; +varying vec3 v_data1; + +void main() { + +#ifdef HAS_UNIFORM_u_fill_color + highp vec4 fill_color = u_fill_color; +#endif + + +#ifdef HAS_UNIFORM_u_halo_color + highp vec4 halo_color = u_halo_color; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + +#ifdef HAS_UNIFORM_u_halo_width + lowp float halo_width = u_halo_width; +#endif + + +#ifdef HAS_UNIFORM_u_halo_blur + lowp float halo_blur = u_halo_blur; +#endif + + + vec2 tex = v_data0.xy; + float gamma_scale = v_data1.x; + float size = v_data1.y; + float fade_opacity = v_data1[2]; + + float fontScale = u_is_text ? size / 24.0 : size; + + lowp vec4 color = fill_color; + highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale); + lowp float buff = (256.0 - 64.0) / 256.0; + if (u_is_halo) { + color = halo_color; + gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale); + buff = (6.0 - halo_width / fontScale) / SDF_PX; + } + + lowp float dist = texture2D(u_texture, tex).a; + highp float gamma_scaled = gamma * gamma_scale; + highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist); + + gl_FragColor = color * (alpha * opacity * fade_opacity); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/gl/symbol_sdf_text.cpp b/src/mbgl/programs/gl/symbol_sdf_text.cpp new file mode 100644 index 0000000000..a0d810d1ce --- /dev/null +++ b/src/mbgl/programs/gl/symbol_sdf_text.cpp @@ -0,0 +1,317 @@ +// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. + +#include +#include +#include + +namespace mbgl { +namespace gfx { + +template <> +std::unique_ptr> +Context::createProgram(const ProgramParameters& programParameters) { + return gl::Program::createProgram( + reinterpret_cast(*this), programParameters, "symbol_sdf_text", + programs::gl::shaderSource() + 53059, programs::gl::shaderSource() + 57099); +} + +} // namespace gfx +} // namespace mbgl + +// Uncompressed source of symbol_sdf_text.vertex.glsl: +/* +const float PI = 3.141592653589793; + +attribute vec4 a_pos_offset; +attribute vec4 a_data; +attribute vec3 a_projected_pos; +attribute float a_fade_opacity; + +// contents of a_size vary based on the type of property value +// used for {text,icon}-size. +// For constants, a_size is disabled. +// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature. +// For composite functions: +// [ text-size(lowerZoomStop, feature), +// text-size(upperZoomStop, feature) ] +uniform bool u_is_size_zoom_constant; +uniform bool u_is_size_feature_constant; +uniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function +uniform highp float u_size; // used when size is both zoom and feature constant + + +#ifndef HAS_UNIFORM_u_fill_color +uniform lowp float a_fill_color_t; +attribute highp vec4 a_fill_color; +varying highp vec4 fill_color; +#else +uniform highp vec4 u_fill_color; +#endif + + +#ifndef HAS_UNIFORM_u_halo_color +uniform lowp float a_halo_color_t; +attribute highp vec4 a_halo_color; +varying highp vec4 halo_color; +#else +uniform highp vec4 u_halo_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +uniform lowp float a_opacity_t; +attribute lowp vec2 a_opacity; +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_halo_width +uniform lowp float a_halo_width_t; +attribute lowp vec2 a_halo_width; +varying lowp float halo_width; +#else +uniform lowp float u_halo_width; +#endif + + +#ifndef HAS_UNIFORM_u_halo_blur +uniform lowp float a_halo_blur_t; +attribute lowp vec2 a_halo_blur; +varying lowp float halo_blur; +#else +uniform lowp float u_halo_blur; +#endif + + +uniform mat4 u_matrix; +uniform mat4 u_label_plane_matrix; +uniform mat4 u_gl_coord_matrix; + +uniform bool u_is_text; +uniform bool u_pitch_with_map; +uniform highp float u_pitch; +uniform bool u_rotate_symbol; +uniform highp float u_aspect_ratio; +uniform highp float u_camera_to_center_distance; +uniform float u_fade_change; + +uniform vec2 u_texsize; + +varying vec2 v_data0; +varying vec3 v_data1; + +void main() { + +#ifndef HAS_UNIFORM_u_fill_color + fill_color = unpack_mix_color(a_fill_color, a_fill_color_t); +#else + highp vec4 fill_color = u_fill_color; +#endif + + +#ifndef HAS_UNIFORM_u_halo_color + halo_color = unpack_mix_color(a_halo_color, a_halo_color_t); +#else + highp vec4 halo_color = u_halo_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity + opacity = unpack_mix_vec2(a_opacity, a_opacity_t); +#else + lowp float opacity = u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_halo_width + halo_width = unpack_mix_vec2(a_halo_width, a_halo_width_t); +#else + lowp float halo_width = u_halo_width; +#endif + + +#ifndef HAS_UNIFORM_u_halo_blur + halo_blur = unpack_mix_vec2(a_halo_blur, a_halo_blur_t); +#else + lowp float halo_blur = u_halo_blur; +#endif + + + vec2 a_pos = a_pos_offset.xy; + vec2 a_offset = a_pos_offset.zw; + + vec2 a_tex = a_data.xy; + vec2 a_size = a_data.zw; + + highp float segment_angle = -a_projected_pos[2]; + float size; + + if (!u_is_size_zoom_constant && !u_is_size_feature_constant) { + size = mix(a_size[0], a_size[1], u_size_t) / 256.0; + } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) { + size = a_size[0] / 256.0; + } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) { + size = u_size; + } else { + size = u_size; + } + + vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1); + highp float camera_to_anchor_distance = projectedPoint.w; + // If the label is pitched with the map, layout is done in pitched space, + // which makes labels in the distance smaller relative to viewport space. + // We counteract part of that effect by multiplying by the perspective ratio. + // If the label isn't pitched with the map, we do layout in viewport space, + // which makes labels in the distance larger relative to the features around + // them. We counteract part of that effect by dividing by the perspective ratio. + highp float distance_ratio = u_pitch_with_map ? + camera_to_anchor_distance / u_camera_to_center_distance : + u_camera_to_center_distance / camera_to_anchor_distance; + highp float perspective_ratio = clamp( + 0.5 + 0.5 * distance_ratio, + 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles + 4.0); + + size *= perspective_ratio; + + float fontScale = u_is_text ? size / 24.0 : size; + + highp float symbol_rotation = 0.0; + if (u_rotate_symbol) { + // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units + // To figure out that angle in projected space, we draw a short horizontal line in tile + // space, project it, and measure its angle in projected space. + vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1); + + vec2 a = projectedPoint.xy / projectedPoint.w; + vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w; + + symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x); + } + + highp float angle_sin = sin(segment_angle + symbol_rotation); + highp float angle_cos = cos(segment_angle + symbol_rotation); + mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); + + vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); + gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); + float gamma_scale = gl_Position.w; + + vec2 tex = a_tex / u_texsize; + vec2 fade_opacity = unpack_opacity(a_fade_opacity); + float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change; + float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change)); + + v_data0 = vec2(tex.x, tex.y); + v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity); +} + +*/ + +// Uncompressed source of symbol_sdf_text.fragment.glsl: +/* +#define SDF_PX 8.0 +#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO + +uniform bool u_is_halo; + +#ifndef HAS_UNIFORM_u_fill_color +varying highp vec4 fill_color; +#else +uniform highp vec4 u_fill_color; +#endif + + +#ifndef HAS_UNIFORM_u_halo_color +varying highp vec4 halo_color; +#else +uniform highp vec4 u_halo_color; +#endif + + +#ifndef HAS_UNIFORM_u_opacity +varying lowp float opacity; +#else +uniform lowp float u_opacity; +#endif + + +#ifndef HAS_UNIFORM_u_halo_width +varying lowp float halo_width; +#else +uniform lowp float u_halo_width; +#endif + + +#ifndef HAS_UNIFORM_u_halo_blur +varying lowp float halo_blur; +#else +uniform lowp float u_halo_blur; +#endif + + +uniform sampler2D u_texture; +uniform highp float u_gamma_scale; +uniform bool u_is_text; + +varying vec2 v_data0; +varying vec3 v_data1; + +void main() { + +#ifdef HAS_UNIFORM_u_fill_color + highp vec4 fill_color = u_fill_color; +#endif + + +#ifdef HAS_UNIFORM_u_halo_color + highp vec4 halo_color = u_halo_color; +#endif + + +#ifdef HAS_UNIFORM_u_opacity + lowp float opacity = u_opacity; +#endif + + +#ifdef HAS_UNIFORM_u_halo_width + lowp float halo_width = u_halo_width; +#endif + + +#ifdef HAS_UNIFORM_u_halo_blur + lowp float halo_blur = u_halo_blur; +#endif + + + vec2 tex = v_data0.xy; + float gamma_scale = v_data1.x; + float size = v_data1.y; + float fade_opacity = v_data1[2]; + + float fontScale = u_is_text ? size / 24.0 : size; + + lowp vec4 color = fill_color; + highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale); + lowp float buff = (256.0 - 64.0) / 256.0; + if (u_is_halo) { + color = halo_color; + gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale); + buff = (6.0 - halo_width / fontScale) / SDF_PX; + } + + lowp float dist = texture2D(u_texture, tex).a; + highp float gamma_scaled = gamma * gamma_scale; + highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist); + + gl_FragColor = color * (alpha * opacity * fade_opacity); + +#ifdef OVERDRAW_INSPECTOR + gl_FragColor = vec4(1.0); +#endif +} + +*/ + diff --git a/src/mbgl/programs/heatmap_program.cpp b/src/mbgl/programs/heatmap_program.cpp index 67f84fbd52..32c30ea313 100644 --- a/src/mbgl/programs/heatmap_program.cpp +++ b/src/mbgl/programs/heatmap_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(HeatmapLayoutVertex) == 4, "expected HeatmapLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/heatmap_program.hpp b/src/mbgl/programs/heatmap_program.hpp index 9e8b9c5357..9563dd8d1b 100644 --- a/src/mbgl/programs/heatmap_program.hpp +++ b/src/mbgl/programs/heatmap_program.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -16,7 +15,6 @@ MBGL_DEFINE_UNIFORM_SCALAR(float, u_intensity); class HeatmapProgram : public Program< HeatmapProgram, - shaders::heatmap, gfx::PrimitiveType::Triangle, TypeList< attributes::a_pos>, @@ -51,7 +49,7 @@ using HeatmapAttributes = HeatmapProgram::AttributeList; class HeatmapLayerPrograms final : public LayerTypePrograms { public: - HeatmapLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + HeatmapLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : heatmap(context, programParameters), heatmapTexture(context, programParameters) {} ProgramMap heatmap; diff --git a/src/mbgl/programs/heatmap_texture_program.cpp b/src/mbgl/programs/heatmap_texture_program.cpp index 3b0e24eab8..04c5ff56a7 100644 --- a/src/mbgl/programs/heatmap_texture_program.cpp +++ b/src/mbgl/programs/heatmap_texture_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(HeatmapTextureLayoutVertex) == 4, "expected HeatmapTextureLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/heatmap_texture_program.hpp b/src/mbgl/programs/heatmap_texture_program.hpp index d718d6961a..954e03f9b6 100644 --- a/src/mbgl/programs/heatmap_texture_program.hpp +++ b/src/mbgl/programs/heatmap_texture_program.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -12,7 +11,6 @@ namespace mbgl { class HeatmapTextureProgram : public Program< HeatmapTextureProgram, - shaders::heatmap_texture, gfx::PrimitiveType::Triangle, TypeList, TypeList< diff --git a/src/mbgl/programs/hillshade_prepare_program.cpp b/src/mbgl/programs/hillshade_prepare_program.cpp index 0c0446d3f5..5bbac9eaec 100644 --- a/src/mbgl/programs/hillshade_prepare_program.cpp +++ b/src/mbgl/programs/hillshade_prepare_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(HillshadePrepareLayoutVertex) == 8, "expected HillshadeLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/hillshade_prepare_program.hpp b/src/mbgl/programs/hillshade_prepare_program.hpp index 9560a4acb0..0243cc1879 100644 --- a/src/mbgl/programs/hillshade_prepare_program.hpp +++ b/src/mbgl/programs/hillshade_prepare_program.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include namespace mbgl { @@ -16,7 +15,6 @@ MBGL_DEFINE_UNIFORM_SCALAR(float, u_maxzoom); class HillshadePrepareProgram : public Program< HillshadePrepareProgram, - shaders::hillshade_prepare, gfx::PrimitiveType::Triangle, TypeList< attributes::a_pos, diff --git a/src/mbgl/programs/hillshade_program.cpp b/src/mbgl/programs/hillshade_program.cpp index f054ad4b74..31673afcd4 100644 --- a/src/mbgl/programs/hillshade_program.cpp +++ b/src/mbgl/programs/hillshade_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(HillshadeLayoutVertex) == 8, "expected HillshadeLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/hillshade_program.hpp b/src/mbgl/programs/hillshade_program.hpp index a82220ed51..68d67917df 100644 --- a/src/mbgl/programs/hillshade_program.hpp +++ b/src/mbgl/programs/hillshade_program.hpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -21,7 +20,6 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_latrange); class HillshadeProgram : public Program< HillshadeProgram, - shaders::hillshade, gfx::PrimitiveType::Triangle, TypeList< attributes::a_pos, @@ -58,7 +56,7 @@ using HillshadeAttributes = HillshadeProgram::AttributeList; class HillshadeLayerPrograms final : public LayerTypePrograms { public: - HillshadeLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + HillshadeLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : hillshade(context, programParameters), hillshadePrepare(context, programParameters) {} HillshadeProgram hillshade; diff --git a/src/mbgl/programs/line_gradient_program.hpp b/src/mbgl/programs/line_gradient_program.hpp new file mode 100644 index 0000000000..c98cd37e98 --- /dev/null +++ b/src/mbgl/programs/line_gradient_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/line_pattern_program.hpp b/src/mbgl/programs/line_pattern_program.hpp new file mode 100644 index 0000000000..c98cd37e98 --- /dev/null +++ b/src/mbgl/programs/line_pattern_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/line_program.cpp b/src/mbgl/programs/line_program.cpp index 2a325e2086..74a1ba3162 100644 --- a/src/mbgl/programs/line_program.cpp +++ b/src/mbgl/programs/line_program.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -8,6 +9,11 @@ namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + using namespace style; static_assert(sizeof(LineLayoutVertex) == 12, "expected LineLayoutVertex size"); diff --git a/src/mbgl/programs/line_program.hpp b/src/mbgl/programs/line_program.hpp index a325e9f5fd..05546e3cbe 100644 --- a/src/mbgl/programs/line_program.hpp +++ b/src/mbgl/programs/line_program.hpp @@ -4,10 +4,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include @@ -36,7 +32,6 @@ using LineLayoutAttributes = TypeList< class LineProgram : public Program< LineProgram, - shaders::line, gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< @@ -103,7 +98,6 @@ public: class LinePatternProgram : public Program< LinePatternProgram, - shaders::line_pattern, gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< @@ -132,7 +126,6 @@ public: class LineSDFProgram : public Program< LineSDFProgram, - shaders::line_sdf, gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< @@ -166,7 +159,6 @@ public: class LineGradientProgram : public Program< LineGradientProgram, - shaders::line_gradient, gfx::PrimitiveType::Triangle, LineLayoutAttributes, TypeList< @@ -192,7 +184,7 @@ using LineAttributes = LineProgram::AttributeList; class LineLayerPrograms final : public LayerTypePrograms { public: - LineLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + LineLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : line(context, programParameters), lineGradient(context, programParameters), lineSDF(context, programParameters), diff --git a/src/mbgl/programs/line_sdf_program.hpp b/src/mbgl/programs/line_sdf_program.hpp new file mode 100644 index 0000000000..c98cd37e98 --- /dev/null +++ b/src/mbgl/programs/line_sdf_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/program.hpp b/src/mbgl/programs/program.hpp index 351bf5bbb1..240da22b4f 100644 --- a/src/mbgl/programs/program.hpp +++ b/src/mbgl/programs/program.hpp @@ -2,13 +2,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include @@ -16,7 +14,6 @@ namespace mbgl { template ; - using ProgramType = gl::Program; + std::unique_ptr> program; - std::unique_ptr> program; - - Program(gl::Context& context, const ProgramParameters& programParameters) - : program(ProgramType::createProgram( - context, - programParameters, - Shaders::name, - Shaders::vertexSource, - Shaders::fragmentSource)) { + Program(gfx::Context& context, const ProgramParameters& programParameters) + : program(context.createProgram(programParameters)) { } static UniformValues computeAllUniformValues( @@ -89,6 +79,11 @@ public: const TextureBindings& textureBindings, const std::string& layerID) { static_assert(Primitive == gfx::PrimitiveTypeOf::value, "incompatible draw mode"); + + if (!program) { + return; + } + for (auto& segment : segments) { auto drawScopeIt = segment.drawScopes.find(layerID); @@ -121,7 +116,7 @@ public: using Binders = typename Program::Binders; using Bitset = typename Binders::Bitset; - ProgramMap(gl::Context& context_, ProgramParameters parameters_) + ProgramMap(gfx::Context& context_, ProgramParameters parameters_) : context(context_), parameters(std::move(parameters_)) { } @@ -139,7 +134,7 @@ public: } private: - gl::Context& context; + gfx::Context& context; ProgramParameters parameters; std::unordered_map programs; }; diff --git a/src/mbgl/programs/programs.cpp b/src/mbgl/programs/programs.cpp index f3b3af8ac9..f82e46c9a2 100644 --- a/src/mbgl/programs/programs.cpp +++ b/src/mbgl/programs/programs.cpp @@ -12,7 +12,7 @@ namespace mbgl { -Programs::Programs(gl::Context& context_, const ProgramParameters& programParameters_) +Programs::Programs(gfx::Context& context_, const ProgramParameters& programParameters_) : debug(context_, programParameters_), clippingMask(context_, programParameters_), context(context_), diff --git a/src/mbgl/programs/programs.hpp b/src/mbgl/programs/programs.hpp index a12a0e8fa6..ca9359b267 100644 --- a/src/mbgl/programs/programs.hpp +++ b/src/mbgl/programs/programs.hpp @@ -20,7 +20,7 @@ class SymbolLayerPrograms; class Programs { public: - Programs(gl::Context&, const ProgramParameters&); + Programs(gfx::Context&, const ProgramParameters&); ~Programs(); BackgroundLayerPrograms& getBackgroundLayerPrograms() noexcept; @@ -47,7 +47,7 @@ private: std::unique_ptr linePrograms; std::unique_ptr symbolPrograms; - gl::Context& context; + gfx::Context& context; ProgramParameters programParameters; }; diff --git a/src/mbgl/programs/raster_program.cpp b/src/mbgl/programs/raster_program.cpp index 6906903e6b..f3b1052284 100644 --- a/src/mbgl/programs/raster_program.cpp +++ b/src/mbgl/programs/raster_program.cpp @@ -1,7 +1,10 @@ #include +#include namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + static_assert(sizeof(RasterLayoutVertex) == 8, "expected RasterLayoutVertex size"); } // namespace mbgl diff --git a/src/mbgl/programs/raster_program.hpp b/src/mbgl/programs/raster_program.hpp index da3676b542..55f1fb0a2e 100644 --- a/src/mbgl/programs/raster_program.hpp +++ b/src/mbgl/programs/raster_program.hpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -24,7 +23,6 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_tl_parent); class RasterProgram : public Program< RasterProgram, - shaders::raster, gfx::PrimitiveType::Triangle, TypeList< attributes::a_pos, @@ -68,7 +66,7 @@ using RasterAttributes = RasterProgram::AttributeList; class RasterLayerPrograms final : public LayerTypePrograms { public: - RasterLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + RasterLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : raster(context, programParameters) {} RasterProgram raster; }; diff --git a/src/mbgl/programs/symbol_icon_program.hpp b/src/mbgl/programs/symbol_icon_program.hpp new file mode 100644 index 0000000000..57f27518d1 --- /dev/null +++ b/src/mbgl/programs/symbol_icon_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/symbol_program.cpp b/src/mbgl/programs/symbol_program.cpp index 3baac795ab..2300dedff3 100644 --- a/src/mbgl/programs/symbol_program.cpp +++ b/src/mbgl/programs/symbol_program.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -9,6 +10,10 @@ namespace mbgl { +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); +template std::unique_ptr> gfx::Context::createProgram(const ProgramParameters&); + using namespace style; static_assert(sizeof(SymbolLayoutVertex) == 16, "expected SymbolLayoutVertex size"); diff --git a/src/mbgl/programs/symbol_program.hpp b/src/mbgl/programs/symbol_program.hpp index 2a5fff53ca..383f5162d8 100644 --- a/src/mbgl/programs/symbol_program.hpp +++ b/src/mbgl/programs/symbol_program.hpp @@ -9,8 +9,6 @@ #include #include #include -#include -#include #include #include #include @@ -240,11 +238,10 @@ public: }; template class SymbolProgram : public SymbolProgramBase { public: @@ -265,19 +262,13 @@ public: using UniformList = TypeListConcat; using UniformValues = gfx::UniformValues; + using TextureList = Textures; using TextureBindings = gfx::TextureBindings; - using ProgramType = gl::Program; + std::unique_ptr> program; - std::unique_ptr program; - - SymbolProgram(gl::Context& context, const ProgramParameters& programParameters) - : program(ProgramType::createProgram( - context, - programParameters, - Shaders::name, - Shaders::vertexSource, - Shaders::fragmentSource)) { + SymbolProgram(gfx::Context& context, const ProgramParameters& programParameters) + : program(context.createProgram(programParameters)) { } static UniformValues computeAllUniformValues( @@ -322,6 +313,11 @@ public: const TextureBindings& textureBindings, const std::string& layerID) { static_assert(Primitive == gfx::PrimitiveTypeOf::value, "incompatible draw mode"); + + if (!program) { + return; + } + for (auto& segment : segments) { auto drawScopeIt = segment.drawScopes.find(layerID); @@ -349,7 +345,6 @@ public: class SymbolIconProgram : public SymbolProgram< SymbolIconProgram, - shaders::symbol_icon, gfx::PrimitiveType::Triangle, SymbolLayoutAttributes, TypeList< @@ -390,7 +385,6 @@ enum class SymbolSDFPart { template class SymbolSDFProgram : public SymbolProgram< Name, - shaders::symbol_sdf, gfx::PrimitiveType::Triangle, SymbolLayoutAttributes, TypeList< @@ -415,7 +409,6 @@ class SymbolSDFProgram : public SymbolProgram< public: using BaseProgram = SymbolProgram< Name, - shaders::symbol_sdf, gfx::PrimitiveType::Triangle, SymbolLayoutAttributes, TypeList< @@ -470,7 +463,7 @@ using SymbolTextAttributes = SymbolSDFTextProgram::AttributeList; class SymbolLayerPrograms final : public LayerTypePrograms { public: - SymbolLayerPrograms(gl::Context& context, const ProgramParameters& programParameters) + SymbolLayerPrograms(gfx::Context& context, const ProgramParameters& programParameters) : symbolIcon(context, programParameters), symbolIconSDF(context, programParameters), symbolGlyph(context, programParameters), diff --git a/src/mbgl/programs/symbol_sdf_icon_program.hpp b/src/mbgl/programs/symbol_sdf_icon_program.hpp new file mode 100644 index 0000000000..57f27518d1 --- /dev/null +++ b/src/mbgl/programs/symbol_sdf_icon_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/programs/symbol_sdf_text_program.hpp b/src/mbgl/programs/symbol_sdf_text_program.hpp new file mode 100644 index 0000000000..57f27518d1 --- /dev/null +++ b/src/mbgl/programs/symbol_sdf_text_program.hpp @@ -0,0 +1,4 @@ +#pragma once + +// Alias +#include diff --git a/src/mbgl/renderer/layers/render_background_layer.cpp b/src/mbgl/renderer/layers/render_background_layer.cpp index df2abc5da8..32e05a38ab 100644 --- a/src/mbgl/renderer/layers/render_background_layer.cpp +++ b/src/mbgl/renderer/layers/render_background_layer.cpp @@ -8,7 +8,8 @@ #include #include #include -#include +#include +#include namespace mbgl { diff --git a/src/mbgl/renderer/layers/render_circle_layer.cpp b/src/mbgl/renderer/layers/render_circle_layer.cpp index 9ef02e7e45..60a3bf8e01 100644 --- a/src/mbgl/renderer/layers/render_circle_layer.cpp +++ b/src/mbgl/renderer/layers/render_circle_layer.cpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp index 9a93a2e6c5..5af4732aa3 100644 --- a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp +++ b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp @@ -13,7 +13,8 @@ #include #include #include -#include +#include +#include namespace mbgl { diff --git a/src/mbgl/renderer/layers/render_fill_layer.cpp b/src/mbgl/renderer/layers/render_fill_layer.cpp index d17bde005e..64f3448c69 100644 --- a/src/mbgl/renderer/layers/render_fill_layer.cpp +++ b/src/mbgl/renderer/layers/render_fill_layer.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/src/mbgl/renderer/layers/render_heatmap_layer.cpp b/src/mbgl/renderer/layers/render_heatmap_layer.cpp index 5bb2bddd74..efc16fb28a 100644 --- a/src/mbgl/renderer/layers/render_heatmap_layer.cpp +++ b/src/mbgl/renderer/layers/render_heatmap_layer.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/mbgl/renderer/layers/render_hillshade_layer.cpp b/src/mbgl/renderer/layers/render_hillshade_layer.cpp index f75c0ef3a5..00ecad444c 100644 --- a/src/mbgl/renderer/layers/render_hillshade_layer.cpp +++ b/src/mbgl/renderer/layers/render_hillshade_layer.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/mbgl/renderer/layers/render_line_layer.cpp b/src/mbgl/renderer/layers/render_line_layer.cpp index 858ecce9ac..eee151ccaa 100644 --- a/src/mbgl/renderer/layers/render_line_layer.cpp +++ b/src/mbgl/renderer/layers/render_line_layer.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/src/mbgl/renderer/layers/render_raster_layer.cpp b/src/mbgl/renderer/layers/render_raster_layer.cpp index 8907d5f9a6..c8f00eb1fd 100644 --- a/src/mbgl/renderer/layers/render_raster_layer.cpp +++ b/src/mbgl/renderer/layers/render_raster_layer.cpp @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include namespace mbgl { diff --git a/src/mbgl/renderer/layers/render_symbol_layer.cpp b/src/mbgl/renderer/layers/render_symbol_layer.cpp index d20473e5d1..31d92dd414 100644 --- a/src/mbgl/renderer/layers/render_symbol_layer.cpp +++ b/src/mbgl/renderer/layers/render_symbol_layer.cpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/mbgl/renderer/render_static_data.cpp b/src/mbgl/renderer/render_static_data.cpp index cae0e0a820..16d0d64a33 100644 --- a/src/mbgl/renderer/render_static_data.cpp +++ b/src/mbgl/renderer/render_static_data.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace mbgl { diff --git a/src/mbgl/renderer/render_static_data.hpp b/src/mbgl/renderer/render_static_data.hpp index da887dff22..b9b52b09ca 100644 --- a/src/mbgl/renderer/render_static_data.hpp +++ b/src/mbgl/renderer/render_static_data.hpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include diff --git a/src/mbgl/renderer/render_tile.cpp b/src/mbgl/renderer/render_tile.cpp index 55f9276947..24826bfd78 100644 --- a/src/mbgl/renderer/render_tile.cpp +++ b/src/mbgl/renderer/render_tile.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/src/mbgl/renderer/sources/render_image_source.cpp b/src/mbgl/renderer/sources/render_image_source.cpp index 51b145d28c..1b135a2838 100644 --- a/src/mbgl/renderer/sources/render_image_source.cpp +++ b/src/mbgl/renderer/sources/render_image_source.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/src/mbgl/shaders/background.cpp b/src/mbgl/shaders/background.cpp deleted file mode 100644 index 60f2d228be..0000000000 --- a/src/mbgl/shaders/background.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* background::name = "background"; -const char* background::vertexSource = source() + 1429; -const char* background::fragmentSource = source() + 1525; - -// Uncompressed source of background.vertex.glsl: -/* -attribute vec2 a_pos; - -uniform mat4 u_matrix; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); -} - -*/ - -// Uncompressed source of background.fragment.glsl: -/* -uniform vec4 u_color; -uniform float u_opacity; - -void main() { - gl_FragColor = u_color * u_opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/background.hpp b/src/mbgl/shaders/background.hpp deleted file mode 100644 index 2fa6f56e29..0000000000 --- a/src/mbgl/shaders/background.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class background { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/background_pattern.cpp b/src/mbgl/shaders/background_pattern.cpp deleted file mode 100644 index 35023455ea..0000000000 --- a/src/mbgl/shaders/background_pattern.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* background_pattern::name = "background_pattern"; -const char* background_pattern::vertexSource = source() + 1675; -const char* background_pattern::fragmentSource = source() + 2266; - -// Uncompressed source of background_pattern.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_pattern_size_a; -uniform vec2 u_pattern_size_b; -uniform vec2 u_pixel_coord_upper; -uniform vec2 u_pixel_coord_lower; -uniform float u_scale_a; -uniform float u_scale_b; -uniform float u_tile_units_to_pixels; - -attribute vec2 a_pos; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); - - v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos); - v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos); -} - -*/ - -// Uncompressed source of background_pattern.fragment.glsl: -/* -uniform vec2 u_pattern_tl_a; -uniform vec2 u_pattern_br_a; -uniform vec2 u_pattern_tl_b; -uniform vec2 u_pattern_br_b; -uniform vec2 u_texsize; -uniform float u_mix; -uniform float u_opacity; - -uniform sampler2D u_image; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; - -void main() { - vec2 imagecoord = mod(v_pos_a, 1.0); - vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord); - vec4 color1 = texture2D(u_image, pos); - - vec2 imagecoord_b = mod(v_pos_b, 1.0); - vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b); - vec4 color2 = texture2D(u_image, pos2); - - gl_FragColor = mix(color1, color2, u_mix) * u_opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/background_pattern.hpp b/src/mbgl/shaders/background_pattern.hpp deleted file mode 100644 index e970ffd670..0000000000 --- a/src/mbgl/shaders/background_pattern.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class background_pattern { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/circle.cpp b/src/mbgl/shaders/circle.cpp deleted file mode 100644 index e5da9fb37e..0000000000 --- a/src/mbgl/shaders/circle.cpp +++ /dev/null @@ -1,294 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* circle::name = "circle"; -const char* circle::vertexSource = source() + 2927; -const char* circle::fragmentSource = source() + 6093; - -// Uncompressed source of circle.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform bool u_scale_with_map; -uniform bool u_pitch_with_map; -uniform vec2 u_extrude_scale; -uniform highp float u_camera_to_center_distance; - -attribute vec2 a_pos; - - -#ifndef HAS_UNIFORM_u_color -uniform lowp float a_color_t; -attribute highp vec4 a_color; -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_radius -uniform lowp float a_radius_t; -attribute mediump vec2 a_radius; -varying mediump float radius; -#else -uniform mediump float u_radius; -#endif - - -#ifndef HAS_UNIFORM_u_blur -uniform lowp float a_blur_t; -attribute lowp vec2 a_blur; -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_color -uniform lowp float a_stroke_color_t; -attribute highp vec4 a_stroke_color; -varying highp vec4 stroke_color; -#else -uniform highp vec4 u_stroke_color; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_width -uniform lowp float a_stroke_width_t; -attribute mediump vec2 a_stroke_width; -varying mediump float stroke_width; -#else -uniform mediump float u_stroke_width; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_opacity -uniform lowp float a_stroke_opacity_t; -attribute lowp vec2 a_stroke_opacity; -varying lowp float stroke_opacity; -#else -uniform lowp float u_stroke_opacity; -#endif - - -varying vec3 v_data; - -void main(void) { - -#ifndef HAS_UNIFORM_u_color - color = unpack_mix_color(a_color, a_color_t); -#else - highp vec4 color = u_color; -#endif - - -#ifndef HAS_UNIFORM_u_radius - radius = unpack_mix_vec2(a_radius, a_radius_t); -#else - mediump float radius = u_radius; -#endif - - -#ifndef HAS_UNIFORM_u_blur - blur = unpack_mix_vec2(a_blur, a_blur_t); -#else - lowp float blur = u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_color - stroke_color = unpack_mix_color(a_stroke_color, a_stroke_color_t); -#else - highp vec4 stroke_color = u_stroke_color; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_width - stroke_width = unpack_mix_vec2(a_stroke_width, a_stroke_width_t); -#else - mediump float stroke_width = u_stroke_width; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_opacity - stroke_opacity = unpack_mix_vec2(a_stroke_opacity, a_stroke_opacity_t); -#else - lowp float stroke_opacity = u_stroke_opacity; -#endif - - - // unencode the extrusion vector that we snuck into the a_pos vector - vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); - - // multiply a_pos by 0.5, since we had it * 2 in order to sneak - // in extrusion data - vec2 circle_center = floor(a_pos * 0.5); - if (u_pitch_with_map) { - vec2 corner_position = circle_center; - if (u_scale_with_map) { - corner_position += extrude * (radius + stroke_width) * u_extrude_scale; - } else { - // Pitching the circle with the map effectively scales it with the map - // To counteract the effect for pitch-scale: viewport, we rescale the - // whole circle based on the pitch scaling effect at its central point - vec4 projected_center = u_matrix * vec4(circle_center, 0, 1); - corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance); - } - - gl_Position = u_matrix * vec4(corner_position, 0, 1); - } else { - gl_Position = u_matrix * vec4(circle_center, 0, 1); - - if (u_scale_with_map) { - gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance; - } else { - gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w; - } - } - - // This is a minimum blur distance that serves as a faux-antialiasing for - // the circle. since blur is a ratio of the circle's size and the intent is - // to keep the blur at roughly 1px, the two are inversely related. - lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width); - - v_data = vec3(extrude.x, extrude.y, antialiasblur); -} - -*/ - -// Uncompressed source of circle.fragment.glsl: -/* - -#ifndef HAS_UNIFORM_u_color -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_radius -varying mediump float radius; -#else -uniform mediump float u_radius; -#endif - - -#ifndef HAS_UNIFORM_u_blur -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_color -varying highp vec4 stroke_color; -#else -uniform highp vec4 u_stroke_color; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_width -varying mediump float stroke_width; -#else -uniform mediump float u_stroke_width; -#endif - - -#ifndef HAS_UNIFORM_u_stroke_opacity -varying lowp float stroke_opacity; -#else -uniform lowp float u_stroke_opacity; -#endif - - -varying vec3 v_data; - -void main() { - -#ifdef HAS_UNIFORM_u_color - highp vec4 color = u_color; -#endif - - -#ifdef HAS_UNIFORM_u_radius - mediump float radius = u_radius; -#endif - - -#ifdef HAS_UNIFORM_u_blur - lowp float blur = u_blur; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - -#ifdef HAS_UNIFORM_u_stroke_color - highp vec4 stroke_color = u_stroke_color; -#endif - - -#ifdef HAS_UNIFORM_u_stroke_width - mediump float stroke_width = u_stroke_width; -#endif - - -#ifdef HAS_UNIFORM_u_stroke_opacity - lowp float stroke_opacity = u_stroke_opacity; -#endif - - - vec2 extrude = v_data.xy; - float extrude_length = length(extrude); - - lowp float antialiasblur = v_data.z; - float antialiased_blur = -max(blur, antialiasblur); - - float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0); - - float color_t = stroke_width < 0.01 ? 0.0 : smoothstep( - antialiased_blur, - 0.0, - extrude_length - radius / (radius + stroke_width) - ); - - gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/circle.hpp b/src/mbgl/shaders/circle.hpp deleted file mode 100644 index d14b26b783..0000000000 --- a/src/mbgl/shaders/circle.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class circle { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/clipping_mask.cpp b/src/mbgl/shaders/clipping_mask.cpp deleted file mode 100644 index 717ebd3e84..0000000000 --- a/src/mbgl/shaders/clipping_mask.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* clipping_mask::name = "clipping_mask"; -const char* clipping_mask::vertexSource = source() + 7848; -const char* clipping_mask::fragmentSource = source() + 7944; - -// Uncompressed source of clipping_mask.vertex.glsl: -/* -attribute vec2 a_pos; - -uniform mat4 u_matrix; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); -} - -*/ - -// Uncompressed source of clipping_mask.fragment.glsl: -/* -void main() { - gl_FragColor = vec4(1.0); -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/clipping_mask.hpp b/src/mbgl/shaders/clipping_mask.hpp deleted file mode 100644 index bd01ab62fa..0000000000 --- a/src/mbgl/shaders/clipping_mask.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class clipping_mask { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/collision_box.cpp b/src/mbgl/shaders/collision_box.cpp deleted file mode 100644 index b016d48cc8..0000000000 --- a/src/mbgl/shaders/collision_box.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* collision_box::name = "collision_box"; -const char* collision_box::vertexSource = source() + 9956; -const char* collision_box::fragmentSource = source() + 10635; - -// Uncompressed source of collision_box.vertex.glsl: -/* -attribute vec2 a_pos; -attribute vec2 a_anchor_pos; -attribute vec2 a_extrude; -attribute vec2 a_placed; -attribute vec2 a_shift; - -uniform mat4 u_matrix; -uniform vec2 u_extrude_scale; -uniform float u_camera_to_center_distance; - -varying float v_placed; -varying float v_notUsed; - -void main() { - vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1); - highp float camera_to_anchor_distance = projectedPoint.w; - highp float collision_perspective_ratio = clamp( - 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance), - 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles - 4.0); - - gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0); - gl_Position.xy += (a_extrude + a_shift) * u_extrude_scale * gl_Position.w * collision_perspective_ratio; - - v_placed = a_placed.x; - v_notUsed = a_placed.y; -} - -*/ - -// Uncompressed source of collision_box.fragment.glsl: -/* - -varying float v_placed; -varying float v_notUsed; - -void main() { - - float alpha = 0.5; - - // Red = collision, hide label - gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha; - - // Blue = no collision, label is showing - if (v_placed > 0.5) { - gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha; - } - - if (v_notUsed > 0.5) { - // This box not used, fade it out - gl_FragColor *= .1; - } -} -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/collision_box.hpp b/src/mbgl/shaders/collision_box.hpp deleted file mode 100644 index e0f70c7968..0000000000 --- a/src/mbgl/shaders/collision_box.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class collision_box { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/collision_circle.cpp b/src/mbgl/shaders/collision_circle.cpp deleted file mode 100644 index 0700ecead5..0000000000 --- a/src/mbgl/shaders/collision_circle.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* collision_circle::name = "collision_circle"; -const char* collision_circle::vertexSource = source() + 10858; -const char* collision_circle::fragmentSource = source() + 11774; - -// Uncompressed source of collision_circle.vertex.glsl: -/* -attribute vec2 a_pos; -attribute vec2 a_anchor_pos; -attribute vec2 a_extrude; -attribute vec2 a_placed; - -uniform mat4 u_matrix; -uniform vec2 u_extrude_scale; -uniform float u_camera_to_center_distance; - -varying float v_placed; -varying float v_notUsed; -varying float v_radius; - -varying vec2 v_extrude; -varying vec2 v_extrude_scale; - -void main() { - vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1); - highp float camera_to_anchor_distance = projectedPoint.w; - highp float collision_perspective_ratio = clamp( - 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance), - 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles - 4.0); - - gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0); - - highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur - gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio; - - v_placed = a_placed.x; - v_notUsed = a_placed.y; - v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius - - v_extrude = a_extrude * padding_factor; - v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio; -} - -*/ - -// Uncompressed source of collision_circle.fragment.glsl: -/* -uniform float u_overscale_factor; - -varying float v_placed; -varying float v_notUsed; -varying float v_radius; -varying vec2 v_extrude; -varying vec2 v_extrude_scale; - -void main() { - float alpha = 0.5; - - // Red = collision, hide label - vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha; - - // Blue = no collision, label is showing - if (v_placed > 0.5) { - color = vec4(0.0, 0.0, 1.0, 0.5) * alpha; - } - - if (v_notUsed > 0.5) { - // This box not used, fade it out - color *= .2; - } - - float extrude_scale_length = length(v_extrude_scale); - float extrude_length = length(v_extrude) * extrude_scale_length; - float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor; - float radius = v_radius * extrude_scale_length; - - float distance_to_edge = abs(extrude_length - radius); - float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge); - - gl_FragColor = opacity_t * color; -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/collision_circle.hpp b/src/mbgl/shaders/collision_circle.hpp deleted file mode 100644 index 12b1bcd445..0000000000 --- a/src/mbgl/shaders/collision_circle.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class collision_circle { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/debug.cpp b/src/mbgl/shaders/debug.cpp deleted file mode 100644 index 9f3a9cbc37..0000000000 --- a/src/mbgl/shaders/debug.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* debug::name = "debug"; -const char* debug::vertexSource = source() + 12450; -const char* debug::fragmentSource = source() + 12546; - -// Uncompressed source of debug.vertex.glsl: -/* -attribute vec2 a_pos; - -uniform mat4 u_matrix; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); -} - -*/ - -// Uncompressed source of debug.fragment.glsl: -/* -uniform highp vec4 u_color; - -void main() { - gl_FragColor = u_color; -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/debug.hpp b/src/mbgl/shaders/debug.hpp deleted file mode 100644 index 207c7bf075..0000000000 --- a/src/mbgl/shaders/debug.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class debug { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/extrusion_texture.cpp b/src/mbgl/shaders/extrusion_texture.cpp deleted file mode 100644 index c254413513..0000000000 --- a/src/mbgl/shaders/extrusion_texture.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* extrusion_texture::name = "extrusion_texture"; -const char* extrusion_texture::vertexSource = source() + 27554; -const char* extrusion_texture::fragmentSource = source() + 27734; - -// Uncompressed source of extrusion_texture.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_world; -attribute vec2 a_pos; -varying vec2 v_pos; - -void main() { - gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1); - - v_pos.x = a_pos.x; - v_pos.y = 1.0 - a_pos.y; -} - -*/ - -// Uncompressed source of extrusion_texture.fragment.glsl: -/* -uniform sampler2D u_image; -uniform float u_opacity; -varying vec2 v_pos; - -void main() { - gl_FragColor = texture2D(u_image, v_pos) * u_opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(0.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/extrusion_texture.hpp b/src/mbgl/shaders/extrusion_texture.hpp deleted file mode 100644 index 05e54c5499..0000000000 --- a/src/mbgl/shaders/extrusion_texture.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class extrusion_texture { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill.cpp b/src/mbgl/shaders/fill.cpp deleted file mode 100644 index 93d69f7e4b..0000000000 --- a/src/mbgl/shaders/fill.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* fill::name = "fill"; -const char* fill::vertexSource = source() + 12610; -const char* fill::fragmentSource = source() + 13254; - -// Uncompressed source of fill.vertex.glsl: -/* -attribute vec2 a_pos; - -uniform mat4 u_matrix; - - -#ifndef HAS_UNIFORM_u_color -uniform lowp float a_color_t; -attribute highp vec4 a_color; -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_color - color = unpack_mix_color(a_color, a_color_t); -#else - highp vec4 color = u_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - - gl_Position = u_matrix * vec4(a_pos, 0, 1); -} - -*/ - -// Uncompressed source of fill.fragment.glsl: -/* - -#ifndef HAS_UNIFORM_u_color -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -void main() { - -#ifdef HAS_UNIFORM_u_color - highp vec4 color = u_color; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - - gl_FragColor = color * opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill.hpp b/src/mbgl/shaders/fill.hpp deleted file mode 100644 index 29fede7b55..0000000000 --- a/src/mbgl/shaders/fill.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class fill { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_extrusion.cpp b/src/mbgl/shaders/fill_extrusion.cpp deleted file mode 100644 index 79241afcc3..0000000000 --- a/src/mbgl/shaders/fill_extrusion.cpp +++ /dev/null @@ -1,136 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* fill_extrusion::name = "fill_extrusion"; -const char* fill_extrusion::vertexSource = source() + 21238; -const char* fill_extrusion::fragmentSource = source() + 23121; - -// Uncompressed source of fill_extrusion.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec3 u_lightcolor; -uniform lowp vec3 u_lightpos; -uniform lowp float u_lightintensity; -uniform float u_vertical_gradient; - -attribute vec2 a_pos; -attribute vec4 a_normal_ed; - -varying vec4 v_color; - - -#ifndef HAS_UNIFORM_u_base -uniform lowp float a_base_t; -attribute highp vec2 a_base; -#else -uniform highp float u_base; -#endif - - -#ifndef HAS_UNIFORM_u_height -uniform lowp float a_height_t; -attribute highp vec2 a_height; -#else -uniform highp float u_height; -#endif - - - -#ifndef HAS_UNIFORM_u_color -uniform lowp float a_color_t; -attribute highp vec4 a_color; -#else -uniform highp vec4 u_color; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_base - highp float base = unpack_mix_vec2(a_base, a_base_t); -#else - highp float base = u_base; -#endif - - -#ifndef HAS_UNIFORM_u_height - highp float height = unpack_mix_vec2(a_height, a_height_t); -#else - highp float height = u_height; -#endif - - -#ifndef HAS_UNIFORM_u_color - highp vec4 color = unpack_mix_color(a_color, a_color_t); -#else - highp vec4 color = u_color; -#endif - - - vec3 normal = a_normal_ed.xyz; - - base = max(0.0, base); - height = max(0.0, height); - - float t = mod(normal.x, 2.0); - - gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1); - - // Relative luminance (how dark/bright is the surface color?) - float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722; - - v_color = vec4(0.0, 0.0, 0.0, 1.0); - - // Add slight ambient lighting so no extrusions are totally black - vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0); - color += ambientlight; - - // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray - float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0); - - // Adjust directional so that - // the range of values for highlight/shading is narrower - // with lower light intensity - // and with lighter/brighter surface colors - directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional); - - // Add gradient along z axis of side surfaces - if (normal.y != 0.0) { - // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient, - // and otherwise calculates the gradient based on base + height - directional *= ( - (1.0 - u_vertical_gradient) + - (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0))); - } - - // Assign final color based on surface + ambient light color, diffuse light directional, and light color - // with lower bounds adjusted to hue of light - // so that shading is tinted with the complementary (opposite) color to the light color - v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0); - v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0); - v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0); -} - -*/ - -// Uncompressed source of fill_extrusion.fragment.glsl: -/* -varying vec4 v_color; - -void main() { - gl_FragColor = v_color; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_extrusion.hpp b/src/mbgl/shaders/fill_extrusion.hpp deleted file mode 100644 index 949ae57f12..0000000000 --- a/src/mbgl/shaders/fill_extrusion.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class fill_extrusion { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_extrusion_pattern.cpp b/src/mbgl/shaders/fill_extrusion_pattern.cpp deleted file mode 100644 index 8ac17828cf..0000000000 --- a/src/mbgl/shaders/fill_extrusion_pattern.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* fill_extrusion_pattern::name = "fill_extrusion_pattern"; -const char* fill_extrusion_pattern::vertexSource = source() + 23237; -const char* fill_extrusion_pattern::fragmentSource = source() + 26157; - -// Uncompressed source of fill_extrusion_pattern.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_pixel_coord_upper; -uniform vec2 u_pixel_coord_lower; -uniform float u_height_factor; -uniform vec4 u_scale; -uniform float u_vertical_gradient; - -uniform vec3 u_lightcolor; -uniform lowp vec3 u_lightpos; -uniform lowp float u_lightintensity; - -attribute vec2 a_pos; -attribute vec4 a_normal_ed; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; -varying vec4 v_lighting; - - -#ifndef HAS_UNIFORM_u_base -uniform lowp float a_base_t; -attribute lowp vec2 a_base; -varying lowp float base; -#else -uniform lowp float u_base; -#endif - - -#ifndef HAS_UNIFORM_u_height -uniform lowp float a_height_t; -attribute lowp vec2 a_height; -varying lowp float height; -#else -uniform lowp float u_height; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -uniform lowp float a_pattern_from_t; -attribute lowp vec4 a_pattern_from; -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -uniform lowp float a_pattern_to_t; -attribute lowp vec4 a_pattern_to; -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_base - base = unpack_mix_vec2(a_base, a_base_t); -#else - lowp float base = u_base; -#endif - - -#ifndef HAS_UNIFORM_u_height - height = unpack_mix_vec2(a_height, a_height_t); -#else - lowp float height = u_height; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from - pattern_from = a_pattern_from; -#else - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to - pattern_to = a_pattern_to; -#else - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - float pixelRatio = u_scale.x; - float tileRatio = u_scale.y; - float fromScale = u_scale.z; - float toScale = u_scale.w; - - vec3 normal = a_normal_ed.xyz; - float edgedistance = a_normal_ed.w; - - vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); - vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); - - base = max(0.0, base); - height = max(0.0, height); - - float t = mod(normal.x, 2.0); - float z = t > 0.0 ? height : base; - - gl_Position = u_matrix * vec4(a_pos, z, 1); - - vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0 - ? a_pos // extrusion top - : vec2(edgedistance, z * u_height_factor); // extrusion side - - v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, pos); - v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, pos); - - v_lighting = vec4(0.0, 0.0, 0.0, 1.0); - float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0); - directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional); - - if (normal.y != 0.0) { - // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient, - // and otherwise calculates the gradient based on base + height - directional *= ( - (1.0 - u_vertical_gradient) + - (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0))); - } - - v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0)); -} - -*/ - -// Uncompressed source of fill_extrusion_pattern.fragment.glsl: -/* -uniform vec2 u_texsize; -uniform float u_fade; - -uniform sampler2D u_image; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; -varying vec4 v_lighting; - - -#ifndef HAS_UNIFORM_u_base -varying lowp float base; -#else -uniform lowp float u_base; -#endif - - -#ifndef HAS_UNIFORM_u_height -varying lowp float height; -#else -uniform lowp float u_height; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifdef HAS_UNIFORM_u_base - lowp float base = u_base; -#endif - - -#ifdef HAS_UNIFORM_u_height - lowp float height = u_height; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_from - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_to - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - vec2 imagecoord = mod(v_pos_a, 1.0); - vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord); - vec4 color1 = texture2D(u_image, pos); - - vec2 imagecoord_b = mod(v_pos_b, 1.0); - vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b); - vec4 color2 = texture2D(u_image, pos2); - - vec4 mixedColor = mix(color1, color2, u_fade); - - gl_FragColor = mixedColor * v_lighting; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_extrusion_pattern.hpp b/src/mbgl/shaders/fill_extrusion_pattern.hpp deleted file mode 100644 index e9ae001d4e..0000000000 --- a/src/mbgl/shaders/fill_extrusion_pattern.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class fill_extrusion_pattern { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_outline.cpp b/src/mbgl/shaders/fill_outline.cpp deleted file mode 100644 index 43d92857d5..0000000000 --- a/src/mbgl/shaders/fill_outline.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* fill_outline::name = "fill_outline"; -const char* fill_outline::vertexSource = source() + 13678; -const char* fill_outline::fragmentSource = source() + 14503; - -// Uncompressed source of fill_outline.vertex.glsl: -/* -attribute vec2 a_pos; - -uniform mat4 u_matrix; -uniform vec2 u_world; - -varying vec2 v_pos; - - -#ifndef HAS_UNIFORM_u_outline_color -uniform lowp float a_outline_color_t; -attribute highp vec4 a_outline_color; -varying highp vec4 outline_color; -#else -uniform highp vec4 u_outline_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_outline_color - outline_color = unpack_mix_color(a_outline_color, a_outline_color_t); -#else - highp vec4 outline_color = u_outline_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - - gl_Position = u_matrix * vec4(a_pos, 0, 1); - v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world; -} - -*/ - -// Uncompressed source of fill_outline.fragment.glsl: -/* - -#ifndef HAS_UNIFORM_u_outline_color -varying highp vec4 outline_color; -#else -uniform highp vec4 u_outline_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -varying vec2 v_pos; - -void main() { - -#ifdef HAS_UNIFORM_u_outline_color - highp vec4 outline_color = u_outline_color; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - - float dist = length(v_pos - gl_FragCoord.xy); - float alpha = 1.0 - smoothstep(0.0, 1.0, dist); - gl_FragColor = outline_color * (alpha * opacity); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_outline.hpp b/src/mbgl/shaders/fill_outline.hpp deleted file mode 100644 index ef685e62fa..0000000000 --- a/src/mbgl/shaders/fill_outline.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class fill_outline { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_outline_pattern.cpp b/src/mbgl/shaders/fill_outline_pattern.cpp deleted file mode 100644 index eeb2177582..0000000000 --- a/src/mbgl/shaders/fill_outline_pattern.cpp +++ /dev/null @@ -1,180 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* fill_outline_pattern::name = "fill_outline_pattern"; -const char* fill_outline_pattern::vertexSource = source() + 15092; -const char* fill_outline_pattern::fragmentSource = source() + 16952; - -// Uncompressed source of fill_outline_pattern.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_world; -uniform vec2 u_pixel_coord_upper; -uniform vec2 u_pixel_coord_lower; -uniform vec4 u_scale; - -attribute vec2 a_pos; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; -varying vec2 v_pos; - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -uniform lowp float a_pattern_from_t; -attribute lowp vec4 a_pattern_from; -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -uniform lowp float a_pattern_to_t; -attribute lowp vec4 a_pattern_to; -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from - pattern_from = a_pattern_from; -#else - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to - pattern_to = a_pattern_to; -#else - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - float pixelRatio = u_scale.x; - float tileRatio = u_scale.y; - float fromScale = u_scale.z; - float toScale = u_scale.w; - - gl_Position = u_matrix * vec4(a_pos, 0, 1); - - vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); - vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); - - v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, a_pos); - v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, a_pos); - - v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world; -} - -*/ - -// Uncompressed source of fill_outline_pattern.fragment.glsl: -/* - -uniform vec2 u_texsize; -uniform sampler2D u_image; -uniform float u_fade; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; -varying vec2 v_pos; - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_from - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_to - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - vec2 imagecoord = mod(v_pos_a, 1.0); - vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord); - vec4 color1 = texture2D(u_image, pos); - - vec2 imagecoord_b = mod(v_pos_b, 1.0); - vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b); - vec4 color2 = texture2D(u_image, pos2); - - // find distance to outline for alpha interpolation - - float dist = length(v_pos - gl_FragCoord.xy); - float alpha = 1.0 - smoothstep(0.0, 1.0, dist); - - - gl_FragColor = mix(color1, color2, u_fade) * alpha * opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_outline_pattern.hpp b/src/mbgl/shaders/fill_outline_pattern.hpp deleted file mode 100644 index e1c7a173f4..0000000000 --- a/src/mbgl/shaders/fill_outline_pattern.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class fill_outline_pattern { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_pattern.cpp b/src/mbgl/shaders/fill_pattern.cpp deleted file mode 100644 index d062ae7ecc..0000000000 --- a/src/mbgl/shaders/fill_pattern.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* fill_pattern::name = "fill_pattern"; -const char* fill_pattern::vertexSource = source() + 18259; -const char* fill_pattern::fragmentSource = source() + 20038; - -// Uncompressed source of fill_pattern.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_pixel_coord_upper; -uniform vec2 u_pixel_coord_lower; -uniform vec4 u_scale; - -attribute vec2 a_pos; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -uniform lowp float a_pattern_from_t; -attribute lowp vec4 a_pattern_from; -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -uniform lowp float a_pattern_to_t; -attribute lowp vec4 a_pattern_to; -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from - pattern_from = a_pattern_from; -#else - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to - pattern_to = a_pattern_to; -#else - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - float pixelRatio = u_scale.x; - float tileZoomRatio = u_scale.y; - float fromScale = u_scale.z; - float toScale = u_scale.w; - - vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); - vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); - gl_Position = u_matrix * vec4(a_pos, 0, 1); - - v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileZoomRatio, a_pos); - v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileZoomRatio, a_pos); -} - -*/ - -// Uncompressed source of fill_pattern.fragment.glsl: -/* -uniform vec2 u_texsize; -uniform float u_fade; - -uniform sampler2D u_image; - -varying vec2 v_pos_a; -varying vec2 v_pos_b; - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_from - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_to - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - vec2 imagecoord = mod(v_pos_a, 1.0); - vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord); - vec4 color1 = texture2D(u_image, pos); - - vec2 imagecoord_b = mod(v_pos_b, 1.0); - vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b); - vec4 color2 = texture2D(u_image, pos2); - - gl_FragColor = mix(color1, color2, u_fade) * opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/fill_pattern.hpp b/src/mbgl/shaders/fill_pattern.hpp deleted file mode 100644 index 4d09519ed8..0000000000 --- a/src/mbgl/shaders/fill_pattern.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class fill_pattern { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/heatmap.cpp b/src/mbgl/shaders/heatmap.cpp deleted file mode 100644 index a768a6d4ad..0000000000 --- a/src/mbgl/shaders/heatmap.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* heatmap::name = "heatmap"; -const char* heatmap::vertexSource = source() + 7983; -const char* heatmap::fragmentSource = source() + 9030; - -// Uncompressed source of heatmap.vertex.glsl: -/* - -#ifndef HAS_UNIFORM_u_weight -uniform lowp float a_weight_t; -attribute highp vec2 a_weight; -varying highp float weight; -#else -uniform highp float u_weight; -#endif - - -#ifndef HAS_UNIFORM_u_radius -uniform lowp float a_radius_t; -attribute mediump vec2 a_radius; -#else -uniform mediump float u_radius; -#endif - - -uniform mat4 u_matrix; -uniform float u_extrude_scale; -uniform float u_opacity; -uniform float u_intensity; - -attribute vec2 a_pos; - -varying vec2 v_extrude; - -// Effective "0" in the kernel density texture to adjust the kernel size to; -// this empirically chosen number minimizes artifacts on overlapping kernels -// for typical heatmap cases (assuming clustered source) -const highp float ZERO = 1.0 / 255.0 / 16.0; - -// Gaussian kernel coefficient: 1 / sqrt(2 * PI) -#define GAUSS_COEF 0.3989422804014327 - -void main(void) { - -#ifndef HAS_UNIFORM_u_weight - weight = unpack_mix_vec2(a_weight, a_weight_t); -#else - highp float weight = u_weight; -#endif - - -#ifndef HAS_UNIFORM_u_radius - mediump float radius = unpack_mix_vec2(a_radius, a_radius_t); -#else - mediump float radius = u_radius; -#endif - - - // unencode the extrusion vector that we snuck into the a_pos vector - vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); - - // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use - // it to produce the vertices of a square mesh framing the point feature - // we're adding to the kernel density texture. We'll also pass it as - // a varying, so that the fragment shader can determine the distance of - // each fragment from the point feature. - // Before we do so, we need to scale it up sufficiently so that the - // kernel falls effectively to zero at the edge of the mesh. - // That is, we want to know S such that - // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO - // Which solves to: - // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0 - float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0; - - // Pass the varying in units of radius - v_extrude = S * unscaled_extrude; - - // Scale by radius and the zoom-based scale factor to produce actual - // mesh position - vec2 extrude = v_extrude * radius * u_extrude_scale; - - // multiply a_pos by 0.5, since we had it * 2 in order to sneak - // in extrusion data - vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1); - - gl_Position = u_matrix * pos; -} - -*/ - -// Uncompressed source of heatmap.fragment.glsl: -/* - -#ifndef HAS_UNIFORM_u_weight -varying highp float weight; -#else -uniform highp float u_weight; -#endif - - -uniform highp float u_intensity; -varying vec2 v_extrude; - -// Gaussian kernel coefficient: 1 / sqrt(2 * PI) -#define GAUSS_COEF 0.3989422804014327 - -void main() { - -#ifdef HAS_UNIFORM_u_weight - highp float weight = u_weight; -#endif - - - // Kernel density estimation with a Gaussian kernel of size 5x5 - float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude); - float val = weight * u_intensity * GAUSS_COEF * exp(d); - - gl_FragColor = vec4(val, 1.0, 1.0, 1.0); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/heatmap.hpp b/src/mbgl/shaders/heatmap.hpp deleted file mode 100644 index a3c64db942..0000000000 --- a/src/mbgl/shaders/heatmap.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class heatmap { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/heatmap_texture.cpp b/src/mbgl/shaders/heatmap_texture.cpp deleted file mode 100644 index 9b881b416f..0000000000 --- a/src/mbgl/shaders/heatmap_texture.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* heatmap_texture::name = "heatmap_texture"; -const char* heatmap_texture::vertexSource = source() + 9491; -const char* heatmap_texture::fragmentSource = source() + 9671; - -// Uncompressed source of heatmap_texture.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_world; -attribute vec2 a_pos; -varying vec2 v_pos; - -void main() { - gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1); - - v_pos.x = a_pos.x; - v_pos.y = 1.0 - a_pos.y; -} - -*/ - -// Uncompressed source of heatmap_texture.fragment.glsl: -/* -uniform sampler2D u_image; -uniform sampler2D u_color_ramp; -uniform float u_opacity; -varying vec2 v_pos; - -void main() { - float t = texture2D(u_image, v_pos).r; - vec4 color = texture2D(u_color_ramp, vec2(t, 0.5)); - gl_FragColor = color * u_opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(0.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/heatmap_texture.hpp b/src/mbgl/shaders/heatmap_texture.hpp deleted file mode 100644 index c51dc6b178..0000000000 --- a/src/mbgl/shaders/heatmap_texture.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class heatmap_texture { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/hillshade.cpp b/src/mbgl/shaders/hillshade.cpp deleted file mode 100644 index 48ddabcba1..0000000000 --- a/src/mbgl/shaders/hillshade.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* hillshade::name = "hillshade"; -const char* hillshade::vertexSource = source() + 29340; -const char* hillshade::fragmentSource = source() + 29511; - -// Uncompressed source of hillshade.vertex.glsl: -/* -uniform mat4 u_matrix; - -attribute vec2 a_pos; -attribute vec2 a_texture_pos; - -varying vec2 v_pos; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); - v_pos = a_texture_pos / 8192.0; -} - -*/ - -// Uncompressed source of hillshade.fragment.glsl: -/* -uniform sampler2D u_image; -varying vec2 v_pos; - -uniform vec2 u_latrange; -uniform vec2 u_light; -uniform vec4 u_shadow; -uniform vec4 u_highlight; -uniform vec4 u_accent; - -#define PI 3.141592653589793 - -void main() { - vec4 pixel = texture2D(u_image, v_pos); - - vec2 deriv = ((pixel.rg * 2.0) - 1.0); - - // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude - // to account for mercator projection distortion. see #4807 for details - float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1])); - // We also multiply the slope by an arbitrary z-factor of 1.25 - float slope = atan(1.25 * length(deriv) / scaleFactor); - float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0); - - float intensity = u_light.x; - // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal - // position property to account for 0deg corresponding to north/the top of the viewport in the style spec - // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal. - float azimuth = u_light.y + PI; - - // We scale the slope exponentially based on intensity, using a calculation similar to - // the exponential interpolation function in the style spec: - // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228 - // so that higher intensity values create more opaque hillshading. - float base = 1.875 - intensity * 1.75; - float maxValue = 0.5 * PI; - float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope; - - // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine - // so that the accent color's rate of change eases in while the shade color's eases out. - float accent = cos(scaledSlope); - // We multiply both the accent and shade color by a clamped intensity value - // so that intensities >= 0.5 do not additionally affect the color values - // while intensity values < 0.5 make the overall color more transparent. - vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0); - float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0); - vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0); - gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/hillshade.hpp b/src/mbgl/shaders/hillshade.hpp deleted file mode 100644 index a4a27cb595..0000000000 --- a/src/mbgl/shaders/hillshade.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class hillshade { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/hillshade_prepare.cpp b/src/mbgl/shaders/hillshade_prepare.cpp deleted file mode 100644 index 9517e1f489..0000000000 --- a/src/mbgl/shaders/hillshade_prepare.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* hillshade_prepare::name = "hillshade_prepare"; -const char* hillshade_prepare::vertexSource = source() + 27925; -const char* hillshade_prepare::fragmentSource = source() + 28218; - -// Uncompressed source of hillshade_prepare.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_dimension; - -attribute vec2 a_pos; -attribute vec2 a_texture_pos; - -varying vec2 v_pos; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); - - highp vec2 epsilon = 1.0 / u_dimension; - float scale = (u_dimension.x - 2.0) / u_dimension.x; - v_pos = (a_texture_pos / 8192.0) * scale + epsilon; -} - -*/ - -// Uncompressed source of hillshade_prepare.fragment.glsl: -/* -#ifdef GL_ES -precision highp float; -#endif - -uniform sampler2D u_image; -varying vec2 v_pos; -uniform vec2 u_dimension; -uniform float u_zoom; -uniform float u_maxzoom; - -float getElevation(vec2 coord, float bias) { - // Convert encoded elevation value to meters - vec4 data = texture2D(u_image, coord) * 255.0; - return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0; -} - -void main() { - vec2 epsilon = 1.0 / u_dimension; - - // queried pixels: - // +-----------+ - // | | | | - // | a | b | c | - // | | | | - // +-----------+ - // | | | | - // | d | e | f | - // | | | | - // +-----------+ - // | | | | - // | g | h | i | - // | | | | - // +-----------+ - - float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0); - float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0); - float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0); - float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0); - float e = getElevation(v_pos, 0.0); - float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0); - float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0); - float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0); - float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0); - - // here we divide the x and y slopes by 8 * pixel size - // where pixel size (aka meters/pixel) is: - // circumference of the world / (pixels per tile * number of tiles) - // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom)) - // which can be reduced to: pow(2, 19.25619978527 - u_zoom) - // we want to vertically exaggerate the hillshading though, because otherwise - // it is barely noticeable at low zooms. to do this, we multiply this by some - // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value - // Here we use a=0.3 which works out to the expression below. see - // nickidlugash's awesome breakdown for more info - // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556 - float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3; - - vec2 deriv = vec2( - (c + f + f + i) - (a + d + d + g), - (g + h + h + i) - (a + b + b + c) - ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom); - - gl_FragColor = clamp(vec4( - deriv.x / 2.0 + 0.5, - deriv.y / 2.0 + 0.5, - 1.0, - 1.0), 0.0, 1.0); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/hillshade_prepare.hpp b/src/mbgl/shaders/hillshade_prepare.hpp deleted file mode 100644 index c38b4a0d19..0000000000 --- a/src/mbgl/shaders/hillshade_prepare.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class hillshade_prepare { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line.cpp b/src/mbgl/shaders/line.cpp deleted file mode 100644 index a7f2a6d439..0000000000 --- a/src/mbgl/shaders/line.cpp +++ /dev/null @@ -1,247 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* line::name = "line"; -const char* line::vertexSource = source() + 30585; -const char* line::fragmentSource = source() + 33509; - -// Uncompressed source of line.vertex.glsl: -/* - - -// the distance over which the line edge fades out. -// Retina devices need a smaller distance to avoid aliasing. -#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 - -// floor(127 / 2) == 63.0 -// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is -// stored in a byte (-128..127). we scale regular normals up to length 63, but -// there are also "special" normals that have a bigger length (of up to 126 in -// this case). -// #define scale 63.0 -#define scale 0.015873016 - -attribute vec4 a_pos_normal; -attribute vec4 a_data; - -uniform mat4 u_matrix; -uniform mediump float u_ratio; -uniform vec2 u_gl_units_to_pixels; - -varying vec2 v_normal; -varying vec2 v_width2; -varying float v_gamma_scale; -varying highp float v_linesofar; - - -#ifndef HAS_UNIFORM_u_color -uniform lowp float a_color_t; -attribute highp vec4 a_color; -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_blur -uniform lowp float a_blur_t; -attribute lowp vec2 a_blur; -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth -uniform lowp float a_gapwidth_t; -attribute mediump vec2 a_gapwidth; -#else -uniform mediump float u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_offset -uniform lowp float a_offset_t; -attribute lowp vec2 a_offset; -#else -uniform lowp float u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_width -uniform lowp float a_width_t; -attribute mediump vec2 a_width; -#else -uniform mediump float u_width; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_color - color = unpack_mix_color(a_color, a_color_t); -#else - highp vec4 color = u_color; -#endif - - -#ifndef HAS_UNIFORM_u_blur - blur = unpack_mix_vec2(a_blur, a_blur_t); -#else - lowp float blur = u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth - mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); -#else - mediump float gapwidth = u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_offset - lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); -#else - lowp float offset = u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_width - mediump float width = unpack_mix_vec2(a_width, a_width_t); -#else - mediump float width = u_width; -#endif - - - vec2 a_extrude = a_data.xy - 128.0; - float a_direction = mod(a_data.z, 4.0) - 1.0; - - v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0; - - vec2 pos = a_pos_normal.xy; - - // x is 1 if it's a round cap, 0 otherwise - // y is 1 if the normal points up, and -1 if it points down - mediump vec2 normal = a_pos_normal.zw; - v_normal = normal; - - // these transformations used to be applied in the JS and native code bases. - // moved them into the shader for clarity and simplicity. - gapwidth = gapwidth / 2.0; - float halfwidth = width / 2.0; - offset = -1.0 * offset; - - float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); - - // Scale the extrusion vector down to a normal and then up by the line width - // of this vertex. - mediump vec2 dist = outset * a_extrude * scale; - - // Calculate the offset when drawing a line that is to the side of the actual line. - // We do this by creating a vector that points towards the extrude, but rotate - // it when we're drawing round end points (a_direction = -1 or 1) since their - // extrude vector points in another direction. - mediump float u = 0.5 * a_direction; - mediump float t = 1.0 - abs(u); - mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); - - vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); - gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; - - // calculate how much the perspective view squishes or stretches the extrude - float extrude_length_without_perspective = length(dist); - float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); - v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; - - v_width2 = vec2(outset, inset); -} - -*/ - -// Uncompressed source of line.fragment.glsl: -/* - -#ifndef HAS_UNIFORM_u_color -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_blur -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -varying vec2 v_width2; -varying vec2 v_normal; -varying float v_gamma_scale; - -void main() { - -#ifdef HAS_UNIFORM_u_color - highp vec4 color = u_color; -#endif - - -#ifdef HAS_UNIFORM_u_blur - lowp float blur = u_blur; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - - // Calculate the distance of the pixel from the line in pixels. - float dist = length(v_normal) * v_width2.s; - - // Calculate the antialiasing fade factor. This is either when fading in - // the line in case of an offset line (v_width2.t) or when fading out - // (v_width2.s) - float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; - float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); - - gl_FragColor = color * (alpha * opacity); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line.hpp b/src/mbgl/shaders/line.hpp deleted file mode 100644 index c0d81e6202..0000000000 --- a/src/mbgl/shaders/line.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class line { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line_gradient.cpp b/src/mbgl/shaders/line_gradient.cpp deleted file mode 100644 index d9ce2af7b1..0000000000 --- a/src/mbgl/shaders/line_gradient.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* line_gradient::name = "line_gradient"; -const char* line_gradient::vertexSource = source() + 34335; -const char* line_gradient::fragmentSource = source() + 37054; - -// Uncompressed source of line_gradient.vertex.glsl: -/* - -// the attribute conveying progress along a line is scaled to [0, 2^15) -#define MAX_LINE_DISTANCE 32767.0 - -// the distance over which the line edge fades out. -// Retina devices need a smaller distance to avoid aliasing. -#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 - -// floor(127 / 2) == 63.0 -// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is -// stored in a byte (-128..127). we scale regular normals up to length 63, but -// there are also "special" normals that have a bigger length (of up to 126 in -// this case). -// #define scale 63.0 -#define scale 0.015873016 - -attribute vec4 a_pos_normal; -attribute vec4 a_data; - -uniform mat4 u_matrix; -uniform mediump float u_ratio; -uniform vec2 u_gl_units_to_pixels; - -varying vec2 v_normal; -varying vec2 v_width2; -varying float v_gamma_scale; -varying highp float v_lineprogress; - - -#ifndef HAS_UNIFORM_u_blur -uniform lowp float a_blur_t; -attribute lowp vec2 a_blur; -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth -uniform lowp float a_gapwidth_t; -attribute mediump vec2 a_gapwidth; -#else -uniform mediump float u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_offset -uniform lowp float a_offset_t; -attribute lowp vec2 a_offset; -#else -uniform lowp float u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_width -uniform lowp float a_width_t; -attribute mediump vec2 a_width; -#else -uniform mediump float u_width; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_blur - blur = unpack_mix_vec2(a_blur, a_blur_t); -#else - lowp float blur = u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth - mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); -#else - mediump float gapwidth = u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_offset - lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); -#else - lowp float offset = u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_width - mediump float width = unpack_mix_vec2(a_width, a_width_t); -#else - mediump float width = u_width; -#endif - - - vec2 a_extrude = a_data.xy - 128.0; - float a_direction = mod(a_data.z, 4.0) - 1.0; - - v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE; - - vec2 pos = a_pos_normal.xy; - - // x is 1 if it's a round cap, 0 otherwise - // y is 1 if the normal points up, and -1 if it points down - mediump vec2 normal = a_pos_normal.zw; - v_normal = normal; - - // these transformations used to be applied in the JS and native code bases. - // moved them into the shader for clarity and simplicity. - gapwidth = gapwidth / 2.0; - float halfwidth = width / 2.0; - offset = -1.0 * offset; - - float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); - - // Scale the extrusion vector down to a normal and then up by the line width - // of this vertex. - mediump vec2 dist = outset * a_extrude * scale; - - // Calculate the offset when drawing a line that is to the side of the actual line. - // We do this by creating a vector that points towards the extrude, but rotate - // it when we're drawing round end points (a_direction = -1 or 1) since their - // extrude vector points in another direction. - mediump float u = 0.5 * a_direction; - mediump float t = 1.0 - abs(u); - mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); - - vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); - gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; - - // calculate how much the perspective view squishes or stretches the extrude - float extrude_length_without_perspective = length(dist); - float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); - v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; - - v_width2 = vec2(outset, inset); -} - -*/ - -// Uncompressed source of line_gradient.fragment.glsl: -/* - - -#ifndef HAS_UNIFORM_u_blur -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -uniform sampler2D u_image; - -varying vec2 v_width2; -varying vec2 v_normal; -varying float v_gamma_scale; -varying highp float v_lineprogress; - -void main() { - -#ifdef HAS_UNIFORM_u_blur - lowp float blur = u_blur; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - - // Calculate the distance of the pixel from the line in pixels. - float dist = length(v_normal) * v_width2.s; - - // Calculate the antialiasing fade factor. This is either when fading in - // the line in case of an offset line (v_width2.t) or when fading out - // (v_width2.s) - float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; - float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); - - // For gradient lines, v_lineprogress is the ratio along the entire line, - // scaled to [0, 2^15), and the gradient ramp is stored in a texture. - vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5)); - - gl_FragColor = color * (alpha * opacity); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line_gradient.hpp b/src/mbgl/shaders/line_gradient.hpp deleted file mode 100644 index 87a9d6d38c..0000000000 --- a/src/mbgl/shaders/line_gradient.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class line_gradient { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line_pattern.cpp b/src/mbgl/shaders/line_pattern.cpp deleted file mode 100644 index 2c05c8c7ec..0000000000 --- a/src/mbgl/shaders/line_pattern.cpp +++ /dev/null @@ -1,316 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* line_pattern::name = "line_pattern"; -const char* line_pattern::vertexSource = source() + 37841; -const char* line_pattern::fragmentSource = source() + 41162; - -// Uncompressed source of line_pattern.vertex.glsl: -/* -// floor(127 / 2) == 63.0 -// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is -// stored in a byte (-128..127). we scale regular normals up to length 63, but -// there are also "special" normals that have a bigger length (of up to 126 in -// this case). -// #define scale 63.0 -#define scale 0.015873016 - -// We scale the distance before adding it to the buffers so that we can store -// long distances for long segments. Use this value to unscale the distance. -#define LINE_DISTANCE_SCALE 2.0 - -// the distance over which the line edge fades out. -// Retina devices need a smaller distance to avoid aliasing. -#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 - -attribute vec4 a_pos_normal; -attribute vec4 a_data; - -uniform mat4 u_matrix; -uniform vec2 u_gl_units_to_pixels; -uniform mediump float u_ratio; - -varying vec2 v_normal; -varying vec2 v_width2; -varying float v_linesofar; -varying float v_gamma_scale; - - -#ifndef HAS_UNIFORM_u_blur -uniform lowp float a_blur_t; -attribute lowp vec2 a_blur; -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_offset -uniform lowp float a_offset_t; -attribute lowp vec2 a_offset; -#else -uniform lowp float u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth -uniform lowp float a_gapwidth_t; -attribute mediump vec2 a_gapwidth; -#else -uniform mediump float u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_width -uniform lowp float a_width_t; -attribute mediump vec2 a_width; -#else -uniform mediump float u_width; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from -uniform lowp float a_pattern_from_t; -attribute lowp vec4 a_pattern_from; -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -uniform lowp float a_pattern_to_t; -attribute lowp vec4 a_pattern_to; -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_blur - blur = unpack_mix_vec2(a_blur, a_blur_t); -#else - lowp float blur = u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_offset - lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); -#else - lowp float offset = u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth - mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); -#else - mediump float gapwidth = u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_width - mediump float width = unpack_mix_vec2(a_width, a_width_t); -#else - mediump float width = u_width; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_from - pattern_from = a_pattern_from; -#else - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to - pattern_to = a_pattern_to; -#else - mediump vec4 pattern_to = u_pattern_to; -#endif - - - vec2 a_extrude = a_data.xy - 128.0; - float a_direction = mod(a_data.z, 4.0) - 1.0; - float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE; - // float tileRatio = u_scale.y; - vec2 pos = a_pos_normal.xy; - - // x is 1 if it's a round cap, 0 otherwise - // y is 1 if the normal points up, and -1 if it points down - mediump vec2 normal = a_pos_normal.zw; - v_normal = normal; - - // these transformations used to be applied in the JS and native code bases. - // moved them into the shader for clarity and simplicity. - gapwidth = gapwidth / 2.0; - float halfwidth = width / 2.0; - offset = -1.0 * offset; - - float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); - - // Scale the extrusion vector down to a normal and then up by the line width - // of this vertex. - mediump vec2 dist = outset * a_extrude * scale; - - // Calculate the offset when drawing a line that is to the side of the actual line. - // We do this by creating a vector that points towards the extrude, but rotate - // it when we're drawing round end points (a_direction = -1 or 1) since their - // extrude vector points in another direction. - mediump float u = 0.5 * a_direction; - mediump float t = 1.0 - abs(u); - mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); - - vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); - gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; - - // calculate how much the perspective view squishes or stretches the extrude - float extrude_length_without_perspective = length(dist); - float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); - v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; - - v_linesofar = a_linesofar; - v_width2 = vec2(outset, inset); -} - -*/ - -// Uncompressed source of line_pattern.fragment.glsl: -/* -uniform vec2 u_texsize; -uniform float u_fade; -uniform mediump vec4 u_scale; - -uniform sampler2D u_image; - -varying vec2 v_normal; -varying vec2 v_width2; -varying float v_linesofar; -varying float v_gamma_scale; - - -#ifndef HAS_UNIFORM_u_pattern_from -varying lowp vec4 pattern_from; -#else -uniform lowp vec4 u_pattern_from; -#endif - - -#ifndef HAS_UNIFORM_u_pattern_to -varying lowp vec4 pattern_to; -#else -uniform lowp vec4 u_pattern_to; -#endif - - -#ifndef HAS_UNIFORM_u_blur -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -void main() { - -#ifdef HAS_UNIFORM_u_pattern_from - mediump vec4 pattern_from = u_pattern_from; -#endif - - -#ifdef HAS_UNIFORM_u_pattern_to - mediump vec4 pattern_to = u_pattern_to; -#endif - - - -#ifdef HAS_UNIFORM_u_blur - lowp float blur = u_blur; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - - vec2 pattern_tl_a = pattern_from.xy; - vec2 pattern_br_a = pattern_from.zw; - vec2 pattern_tl_b = pattern_to.xy; - vec2 pattern_br_b = pattern_to.zw; - - float pixelRatio = u_scale.x; - float tileZoomRatio = u_scale.y; - float fromScale = u_scale.z; - float toScale = u_scale.w; - - vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio); - vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio); - - vec2 pattern_size_a = vec2(display_size_a.x * fromScale / tileZoomRatio, display_size_a.y); - vec2 pattern_size_b = vec2(display_size_b.x * toScale / tileZoomRatio, display_size_b.y); - - // Calculate the distance of the pixel from the line in pixels. - float dist = length(v_normal) * v_width2.s; - - // Calculate the antialiasing fade factor. This is either when fading in - // the line in case of an offset line (v_width2.t) or when fading out - // (v_width2.s) - float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; - float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); - - float x_a = mod(v_linesofar / pattern_size_a.x, 1.0); - float x_b = mod(v_linesofar / pattern_size_b.x, 1.0); - - // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge - // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0) - // to ensure we don't sample outside the designated symbol on the sprite sheet. - // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of - // the texture coordinate - float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_a.y + 2.0) / 2.0) / pattern_size_a.y); - float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_b.y + 2.0) / 2.0) / pattern_size_b.y); - vec2 pos_a = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, vec2(x_a, y_a)); - vec2 pos_b = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, vec2(x_b, y_b)); - - vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade); - - gl_FragColor = color * alpha * opacity; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line_pattern.hpp b/src/mbgl/shaders/line_pattern.hpp deleted file mode 100644 index 0394e83fe0..0000000000 --- a/src/mbgl/shaders/line_pattern.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class line_pattern { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line_sdf.cpp b/src/mbgl/shaders/line_sdf.cpp deleted file mode 100644 index 05695abd1b..0000000000 --- a/src/mbgl/shaders/line_sdf.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* line_sdf::name = "line_sdf"; -const char* line_sdf::vertexSource = source() + 43475; -const char* line_sdf::fragmentSource = source() + 47089; - -// Uncompressed source of line_sdf.vertex.glsl: -/* -// floor(127 / 2) == 63.0 -// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is -// stored in a byte (-128..127). we scale regular normals up to length 63, but -// there are also "special" normals that have a bigger length (of up to 126 in -// this case). -// #define scale 63.0 -#define scale 0.015873016 - -// We scale the distance before adding it to the buffers so that we can store -// long distances for long segments. Use this value to unscale the distance. -#define LINE_DISTANCE_SCALE 2.0 - -// the distance over which the line edge fades out. -// Retina devices need a smaller distance to avoid aliasing. -#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0 - -attribute vec4 a_pos_normal; -attribute vec4 a_data; - -uniform mat4 u_matrix; -uniform mediump float u_ratio; -uniform vec2 u_patternscale_a; -uniform float u_tex_y_a; -uniform vec2 u_patternscale_b; -uniform float u_tex_y_b; -uniform vec2 u_gl_units_to_pixels; - -varying vec2 v_normal; -varying vec2 v_width2; -varying vec2 v_tex_a; -varying vec2 v_tex_b; -varying float v_gamma_scale; - - -#ifndef HAS_UNIFORM_u_color -uniform lowp float a_color_t; -attribute highp vec4 a_color; -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_blur -uniform lowp float a_blur_t; -attribute lowp vec2 a_blur; -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth -uniform lowp float a_gapwidth_t; -attribute mediump vec2 a_gapwidth; -#else -uniform mediump float u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_offset -uniform lowp float a_offset_t; -attribute lowp vec2 a_offset; -#else -uniform lowp float u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_width -uniform lowp float a_width_t; -attribute mediump vec2 a_width; -varying mediump float width; -#else -uniform mediump float u_width; -#endif - - -#ifndef HAS_UNIFORM_u_floorwidth -uniform lowp float a_floorwidth_t; -attribute lowp vec2 a_floorwidth; -varying lowp float floorwidth; -#else -uniform lowp float u_floorwidth; -#endif - - -void main() { - -#ifndef HAS_UNIFORM_u_color - color = unpack_mix_color(a_color, a_color_t); -#else - highp vec4 color = u_color; -#endif - - -#ifndef HAS_UNIFORM_u_blur - blur = unpack_mix_vec2(a_blur, a_blur_t); -#else - lowp float blur = u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_gapwidth - mediump float gapwidth = unpack_mix_vec2(a_gapwidth, a_gapwidth_t); -#else - mediump float gapwidth = u_gapwidth; -#endif - - -#ifndef HAS_UNIFORM_u_offset - lowp float offset = unpack_mix_vec2(a_offset, a_offset_t); -#else - lowp float offset = u_offset; -#endif - - -#ifndef HAS_UNIFORM_u_width - width = unpack_mix_vec2(a_width, a_width_t); -#else - mediump float width = u_width; -#endif - - -#ifndef HAS_UNIFORM_u_floorwidth - floorwidth = unpack_mix_vec2(a_floorwidth, a_floorwidth_t); -#else - lowp float floorwidth = u_floorwidth; -#endif - - - vec2 a_extrude = a_data.xy - 128.0; - float a_direction = mod(a_data.z, 4.0) - 1.0; - float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE; - - vec2 pos = a_pos_normal.xy; - - // x is 1 if it's a round cap, 0 otherwise - // y is 1 if the normal points up, and -1 if it points down - mediump vec2 normal = a_pos_normal.zw; - v_normal = normal; - - // these transformations used to be applied in the JS and native code bases. - // moved them into the shader for clarity and simplicity. - gapwidth = gapwidth / 2.0; - float halfwidth = width / 2.0; - offset = -1.0 * offset; - - float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0); - float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING); - - // Scale the extrusion vector down to a normal and then up by the line width - // of this vertex. - mediump vec2 dist =outset * a_extrude * scale; - - // Calculate the offset when drawing a line that is to the side of the actual line. - // We do this by creating a vector that points towards the extrude, but rotate - // it when we're drawing round end points (a_direction = -1 or 1) since their - // extrude vector points in another direction. - mediump float u = 0.5 * a_direction; - mediump float t = 1.0 - abs(u); - mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t); - - vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0); - gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude; - - // calculate how much the perspective view squishes or stretches the extrude - float extrude_length_without_perspective = length(dist); - float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels); - v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective; - - v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a); - v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b); - - v_width2 = vec2(outset, inset); -} - -*/ - -// Uncompressed source of line_sdf.fragment.glsl: -/* - -uniform sampler2D u_image; -uniform float u_sdfgamma; -uniform float u_mix; - -varying vec2 v_normal; -varying vec2 v_width2; -varying vec2 v_tex_a; -varying vec2 v_tex_b; -varying float v_gamma_scale; - - -#ifndef HAS_UNIFORM_u_color -varying highp vec4 color; -#else -uniform highp vec4 u_color; -#endif - - -#ifndef HAS_UNIFORM_u_blur -varying lowp float blur; -#else -uniform lowp float u_blur; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_width -varying mediump float width; -#else -uniform mediump float u_width; -#endif - - -#ifndef HAS_UNIFORM_u_floorwidth -varying lowp float floorwidth; -#else -uniform lowp float u_floorwidth; -#endif - - -void main() { - -#ifdef HAS_UNIFORM_u_color - highp vec4 color = u_color; -#endif - - -#ifdef HAS_UNIFORM_u_blur - lowp float blur = u_blur; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - -#ifdef HAS_UNIFORM_u_width - mediump float width = u_width; -#endif - - -#ifdef HAS_UNIFORM_u_floorwidth - lowp float floorwidth = u_floorwidth; -#endif - - - // Calculate the distance of the pixel from the line in pixels. - float dist = length(v_normal) * v_width2.s; - - // Calculate the antialiasing fade factor. This is either when fading in - // the line in case of an offset line (v_width2.t) or when fading out - // (v_width2.s) - float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale; - float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0); - - float sdfdist_a = texture2D(u_image, v_tex_a).a; - float sdfdist_b = texture2D(u_image, v_tex_b).a; - float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix); - alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist); - - gl_FragColor = color * (alpha * opacity); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/line_sdf.hpp b/src/mbgl/shaders/line_sdf.hpp deleted file mode 100644 index 1d4b566f25..0000000000 --- a/src/mbgl/shaders/line_sdf.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class line_sdf { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/preludes.cpp b/src/mbgl/shaders/preludes.cpp deleted file mode 100644 index a9a507742c..0000000000 --- a/src/mbgl/shaders/preludes.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* vertexPrelude = source() + 0; -const char* fragmentPrelude = source() + 1252; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/preludes.hpp b/src/mbgl/shaders/preludes.hpp deleted file mode 100644 index a3abc9001f..0000000000 --- a/src/mbgl/shaders/preludes.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -extern const char* vertexPrelude; -extern const char* fragmentPrelude; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/raster.cpp b/src/mbgl/shaders/raster.cpp deleted file mode 100644 index 9fcf995915..0000000000 --- a/src/mbgl/shaders/raster.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* raster::name = "raster"; -const char* raster::vertexSource = source() + 48592; -const char* raster::fragmentSource = source() + 48941; - -// Uncompressed source of raster.vertex.glsl: -/* -uniform mat4 u_matrix; -uniform vec2 u_tl_parent; -uniform float u_scale_parent; -uniform float u_buffer_scale; - -attribute vec2 a_pos; -attribute vec2 a_texture_pos; - -varying vec2 v_pos0; -varying vec2 v_pos1; - -void main() { - gl_Position = u_matrix * vec4(a_pos, 0, 1); - // We are using Int16 for texture position coordinates to give us enough precision for - // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer - // as an arbitrarily high number to preserve adequate precision when rendering. - // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates, - // so math for modifying either is consistent. - v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5; - v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent; -} - -*/ - -// Uncompressed source of raster.fragment.glsl: -/* -uniform float u_fade_t; -uniform float u_opacity; -uniform sampler2D u_image0; -uniform sampler2D u_image1; -varying vec2 v_pos0; -varying vec2 v_pos1; - -uniform float u_brightness_low; -uniform float u_brightness_high; - -uniform float u_saturation_factor; -uniform float u_contrast_factor; -uniform vec3 u_spin_weights; - -void main() { - - // read and cross-fade colors from the main and parent tiles - vec4 color0 = texture2D(u_image0, v_pos0); - vec4 color1 = texture2D(u_image1, v_pos1); - if (color0.a > 0.0) { - color0.rgb = color0.rgb / color0.a; - } - if (color1.a > 0.0) { - color1.rgb = color1.rgb / color1.a; - } - vec4 color = mix(color0, color1, u_fade_t); - color.a *= u_opacity; - vec3 rgb = color.rgb; - - // spin - rgb = vec3( - dot(rgb, u_spin_weights.xyz), - dot(rgb, u_spin_weights.zxy), - dot(rgb, u_spin_weights.yzx)); - - // saturation - float average = (color.r + color.g + color.b) / 3.0; - rgb += (average - rgb) * u_saturation_factor; - - // contrast - rgb = (rgb - 0.5) * u_contrast_factor + 0.5; - - // brightness - vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low); - vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high); - - gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/raster.hpp b/src/mbgl/shaders/raster.hpp deleted file mode 100644 index 791e2c8be0..0000000000 --- a/src/mbgl/shaders/raster.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class raster { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/shaders.cpp b/src/mbgl/shaders/shaders.cpp deleted file mode 100644 index 578c2db624..0000000000 --- a/src/mbgl/shaders/shaders.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include - -#include - -namespace mbgl { -namespace shaders { - -std::string fragmentSource(const ProgramParameters& parameters, const char* fragmentSource) { - return parameters.getDefines() + fragmentPrelude + fragmentSource; -} - -std::string vertexSource(const ProgramParameters& parameters, const char* vertexSource) { - return parameters.getDefines() + vertexPrelude + vertexSource; -} - -std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource) { - std::string result; - result.reserve((sizeof(size_t) * 2) * 2 + 2); // 2 size_t hex values + "v2" - result += util::toHex(std::hash()(vertexSource)); - result += util::toHex(std::hash()(fragmentSource)); - result += "v3"; - return result; -} - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/shaders.hpp b/src/mbgl/shaders/shaders.hpp deleted file mode 100644 index 513d37fa6f..0000000000 --- a/src/mbgl/shaders/shaders.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace mbgl { - -class ProgramParameters; - -namespace shaders { - -std::string fragmentSource(const ProgramParameters&, const char* fragmentSource); -std::string vertexSource(const ProgramParameters&, const char* vertexSource); -std::string programIdentifier(const std::string& vertexSource, const std::string& fragmentSource); - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/source.cpp b/src/mbgl/shaders/source.cpp deleted file mode 100644 index bc105946ba..0000000000 --- a/src/mbgl/shaders/source.cpp +++ /dev/null @@ -1,917 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -#include - -namespace mbgl { -namespace shaders { - -const char* source() { - static const uint8_t compressed[] = { - 0x78, 0xda, 0xed, 0x3d, 0xfd, 0x6f, 0xe3, 0x36, - 0xb2, 0xf7, 0x73, 0xfe, 0x0a, 0x17, 0x05, 0x0e, - 0x92, 0x2c, 0x5b, 0xb6, 0x93, 0xec, 0x97, 0x4e, - 0xaf, 0x08, 0x76, 0xb3, 0x7d, 0x01, 0xda, 0xdd, - 0x60, 0xd3, 0xf6, 0x15, 0x57, 0x2c, 0x0c, 0xc9, - 0x56, 0x6c, 0xdf, 0xd9, 0x96, 0x9f, 0xad, 0x24, - 0x76, 0x0e, 0xf9, 0xdf, 0x1f, 0x87, 0xdf, 0xa4, - 0x48, 0x59, 0x76, 0x12, 0xe7, 0xe3, 0x19, 0x45, - 0x37, 0x16, 0x39, 0x1c, 0x0e, 0xc9, 0xe1, 0x70, - 0x66, 0x48, 0x0e, 0x7f, 0x1c, 0x5d, 0xf6, 0xd3, - 0xcb, 0xda, 0xcf, 0xbf, 0x74, 0x4f, 0x2f, 0x0e, - 0x66, 0xf3, 0xb4, 0x37, 0x5a, 0x8c, 0xb2, 0x69, - 0x6d, 0x38, 0x1a, 0x0c, 0x67, 0xb5, 0xcb, 0x71, - 0x16, 0xe7, 0xe1, 0xc1, 0x8f, 0xe9, 0x78, 0x91, - 0x1e, 0xfc, 0x38, 0xba, 0xac, 0xfd, 0x80, 0x60, - 0x47, 0xd3, 0xb4, 0xef, 0x8c, 0xb3, 0x9b, 0x99, - 0x7b, 0xf0, 0x23, 0xf9, 0xac, 0xc1, 0x17, 0x82, - 0x9a, 0xf6, 0x47, 0x97, 0x2a, 0xd8, 0x24, 0xed, - 0x8f, 0xae, 0x26, 0x12, 0x24, 0x4d, 0x30, 0x02, - 0xe3, 0x3a, 0x05, 0x28, 0xfe, 0xe4, 0x80, 0xe4, - 0xcf, 0x75, 0xda, 0xeb, 0xd4, 0xae, 0xa6, 0xb3, - 0xb8, 0xf7, 0xef, 0x2e, 0x26, 0xce, 0xe9, 0x65, - 0xd3, 0x45, 0x4e, 0x08, 0xad, 0x41, 0x72, 0xda, - 0xff, 0x23, 0x1e, 0x5f, 0xa5, 0x6e, 0xed, 0x3f, - 0xa3, 0x29, 0x4b, 0x39, 0x9b, 0xe6, 0x38, 0x31, - 0x42, 0x49, 0x8e, 0x0c, 0x14, 0x02, 0xcc, 0x75, - 0x2b, 0x52, 0xc1, 0x82, 0xce, 0xf1, 0x9b, 0x70, - 0x9e, 0xe6, 0x57, 0xf3, 0x69, 0x0d, 0x2a, 0x74, - 0xae, 0x5b, 0xbe, 0x0a, 0xd1, 0xb8, 0x6e, 0x79, - 0x08, 0xc8, 0x0d, 0xef, 0x64, 0x82, 0x32, 0xf4, - 0xef, 0x28, 0x5f, 0x19, 0x48, 0xfa, 0x4a, 0x72, - 0x28, 0x51, 0xe8, 0x7f, 0x9a, 0x20, 0x11, 0xc4, - 0x40, 0x82, 0x8e, 0x52, 0x35, 0x69, 0xa4, 0x28, - 0xe1, 0x06, 0xed, 0xce, 0xdb, 0x66, 0xcb, 0x9f, - 0x64, 0x7d, 0xb5, 0xa0, 0xdf, 0x69, 0xb6, 0x5c, - 0x42, 0xd0, 0x51, 0xad, 0x9f, 0xf6, 0xb2, 0x7e, - 0xda, 0xed, 0x65, 0xe3, 0x6c, 0x4e, 0xc9, 0xc1, - 0x84, 0xa6, 0x53, 0x48, 0xef, 0x7f, 0x84, 0x74, - 0x44, 0x8c, 0xa8, 0xe8, 0xc8, 0x51, 0x3a, 0x55, - 0x86, 0xfb, 0xab, 0xf5, 0x1d, 0x11, 0x75, 0x7c, - 0x8c, 0x2a, 0xb5, 0xc3, 0xb4, 0x19, 0xcc, 0x01, - 0x22, 0x81, 0xb4, 0x9c, 0x02, 0x4f, 0x46, 0xcb, - 0x2e, 0x6e, 0x89, 0x44, 0x86, 0x34, 0x04, 0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cb, 0x38, 0x2a, 0x8b, 0x9e, 0x9f, - 0x94, 0xfb, 0x1b, 0xa2, 0x7f, 0x3e, 0x4a, 0xae, - 0xf2, 0x94, 0x74, 0x78, 0x0c, 0x83, 0x1e, 0xa2, - 0x16, 0x5f, 0x66, 0xf3, 0x09, 0xe2, 0xb7, 0x1c, - 0x31, 0x7d, 0x17, 0xfd, 0x99, 0x8f, 0x96, 0xe1, - 0x75, 0x36, 0xea, 0xa3, 0xa4, 0xd1, 0xd4, 0x41, - 0x63, 0x32, 0x18, 0x77, 0xcf, 0xb3, 0xc5, 0x28, - 0x47, 0xad, 0x8b, 0x18, 0x84, 0x87, 0xa7, 0x37, - 0x46, 0xe1, 0xb7, 0xfc, 0xb6, 0x0b, 0x1d, 0xc2, - 0x50, 0x91, 0xf9, 0x43, 0x38, 0x96, 0xe3, 0xa7, - 0xd3, 0x97, 0x89, 0xb3, 0x42, 0x0d, 0x9f, 0xe7, - 0xf1, 0x80, 0x30, 0x3c, 0x2d, 0xe9, 0x09, 0xd8, - 0x03, 0xda, 0xd5, 0x5f, 0xff, 0x38, 0xfd, 0xf6, - 0xe9, 0xdb, 0xc9, 0xff, 0x74, 0xcf, 0xbe, 0x5c, - 0x9c, 0x9f, 0x7e, 0xfc, 0xed, 0xeb, 0xb7, 0x03, - 0xa5, 0x24, 0xa6, 0xa9, 0x8d, 0x24, 0x56, 0xc8, - 0xda, 0x2c, 0x51, 0xa5, 0x36, 0x50, 0xa2, 0x15, - 0x49, 0xda, 0xae, 0x3c, 0xb6, 0xdd, 0xb8, 0x34, - 0x37, 0x29, 0xe4, 0xea, 0xac, 0x59, 0x06, 0x80, - 0x39, 0xb0, 0xd0, 0x29, 0x8b, 0x5e, 0x3c, 0x96, - 0xeb, 0x55, 0xd3, 0x93, 0x42, 0xba, 0x89, 0x57, - 0x43, 0xe3, 0xf0, 0x5e, 0xc7, 0xf3, 0xd5, 0x68, - 0x3a, 0x20, 0x49, 0xd7, 0x90, 0x84, 0xaa, 0x31, - 0x24, 0x26, 0x5b, 0x0c, 0x39, 0x45, 0x17, 0xe9, - 0x72, 0xc4, 0xd0, 0x25, 0xbe, 0xa1, 0x17, 0x7c, - 0xde, 0x6e, 0x4f, 0x1f, 0x00, 0xdf, 0xdc, 0x44, - 0x1f, 0x57, 0xce, 0x2a, 0x4e, 0xee, 0x5d, 0x71, - 0xa2, 0x57, 0x9c, 0xac, 0xa9, 0x58, 0x65, 0x72, - 0x99, 0x35, 0xf2, 0xb1, 0x9d, 0x6d, 0x92, 0xb9, - 0x3d, 0x0f, 0x95, 0x4b, 0x4a, 0xca, 0x15, 0xf2, - 0xf2, 0x74, 0x89, 0xe5, 0x8f, 0xce, 0x11, 0x13, - 0x89, 0xa7, 0xf5, 0xa9, 0xc6, 0xd2, 0x17, 0xf1, - 0x64, 0x36, 0x4e, 0xe7, 0x9d, 0x4f, 0x28, 0x6f, - 0x34, 0x89, 0x07, 0xe9, 0xb6, 0xdc, 0x81, 0x73, - 0x30, 0x06, 0xdc, 0xab, 0x58, 0x50, 0xd3, 0xd2, - 0x3e, 0x9e, 0x7e, 0x4c, 0xa0, 0x47, 0xb0, 0x02, - 0xa9, 0x9d, 0x14, 0xf0, 0x36, 0xf8, 0x6a, 0x0f, - 0x49, 0x19, 0x02, 0x35, 0x5d, 0x0c, 0xb1, 0x40, - 0x68, 0x47, 0x28, 0x1f, 0xc9, 0xea, 0xb4, 0xf3, - 0xc9, 0xa1, 0x0d, 0xf0, 0x09, 0x3b, 0xa8, 0xe4, - 0x20, 0xc6, 0x10, 0x04, 0x25, 0x2a, 0x41, 0x9d, - 0x22, 0x45, 0x89, 0x8d, 0xa2, 0xc4, 0x48, 0x51, - 0x37, 0x91, 0x69, 0xea, 0x98, 0x69, 0xea, 0xb8, - 0xa1, 0x22, 0x98, 0xa0, 0x52, 0xd2, 0x06, 0x9f, - 0x14, 0xf3, 0xf1, 0x88, 0xb9, 0xbb, 0x91, 0x71, - 0x49, 0x96, 0x8d, 0xb9, 0x30, 0xb9, 0x19, 0xe5, - 0x43, 0x04, 0x30, 0xd3, 0x73, 0x67, 0xa3, 0xbc, - 0x37, 0x2c, 0xe6, 0x52, 0xb6, 0x43, 0x8d, 0x9c, - 0x5f, 0x21, 0x2d, 0x04, 0xe3, 0xe0, 0x99, 0x92, - 0x3a, 0x0f, 0xf2, 0x3e, 0x9e, 0xa4, 0xf3, 0x18, - 0x26, 0x4d, 0x2f, 0x9d, 0xa2, 0x4e, 0xec, 0xf6, - 0x47, 0x8b, 0x3c, 0x9e, 0xf6, 0x52, 0xb3, 0x64, - 0x82, 0x06, 0x4f, 0xa1, 0xc5, 0xff, 0x7d, 0x72, - 0xd1, 0xfd, 0xfd, 0xcb, 0xd9, 0xe7, 0xaf, 0xdf, - 0x7e, 0xed, 0x52, 0xd9, 0x7f, 0xc0, 0x6a, 0x80, - 0xc5, 0x91, 0x56, 0x10, 0x93, 0xac, 0x6e, 0x2e, - 0xa1, 0x23, 0x04, 0xe0, 0xe1, 0xa0, 0xd9, 0x9c, - 0x7b, 0xa5, 0x2c, 0x92, 0x41, 0x57, 0x62, 0x95, - 0x76, 0x65, 0xa9, 0x92, 0x16, 0x56, 0x03, 0x61, - 0xf3, 0x18, 0xad, 0xbe, 0x0b, 0x33, 0x65, 0x24, - 0x4f, 0x21, 0x8d, 0xa9, 0x01, 0xb4, 0xc5, 0x04, - 0x82, 0x53, 0xa7, 0x28, 0x09, 0x35, 0x9a, 0xa9, - 0x51, 0xa8, 0xc2, 0x30, 0x02, 0xd6, 0x50, 0x99, - 0x8c, 0xaf, 0x2c, 0xbd, 0x07, 0x39, 0x0a, 0x85, - 0x38, 0x97, 0x92, 0x07, 0x99, 0x9c, 0x38, 0xa9, - 0x18, 0x4e, 0xd7, 0xe8, 0x92, 0xb2, 0x49, 0x7d, - 0x6b, 0x48, 0xa2, 0x1c, 0x6e, 0xa6, 0x8a, 0x66, - 0x5a, 0x09, 0xe3, 0xea, 0x42, 0x91, 0x36, 0x31, - 0x73, 0xec, 0xe4, 0x49, 0x30, 0x25, 0x14, 0x2e, - 0xf2, 0x79, 0xf6, 0xef, 0xb4, 0x8c, 0xf5, 0x64, - 0x08, 0x3b, 0x07, 0xca, 0x50, 0x26, 0x46, 0x54, - 0xf2, 0xcb, 0xf8, 0x51, 0x07, 0x5c, 0x4f, 0xfb, - 0xcd, 0xa8, 0x9f, 0x0f, 0x4b, 0x69, 0xc7, 0x10, - 0x65, 0x2c, 0x2a, 0xc3, 0x59, 0x18, 0x55, 0x01, - 0x59, 0xc3, 0xae, 0x3a, 0xec, 0xfa, 0x36, 0x94, - 0x32, 0x8a, 0x0a, 0x63, 0xe5, 0x17, 0x15, 0xcc, - 0xc4, 0x36, 0x1a, 0x44, 0x19, 0xf7, 0x14, 0x41, - 0x89, 0xbb, 0x40, 0x2c, 0x90, 0x87, 0x68, 0x81, - 0xec, 0xc7, 0x79, 0x2c, 0xad, 0x8f, 0xf0, 0x0b, - 0xad, 0x91, 0xa5, 0xe2, 0xad, 0x47, 0x14, 0x5d, - 0xdd, 0xc4, 0xa4, 0x32, 0xcc, 0xe7, 0xa2, 0xce, - 0x65, 0xe4, 0xe9, 0xd2, 0x2c, 0xda, 0x48, 0x66, - 0x91, 0x3f, 0x91, 0x6e, 0x3b, 0x33, 0xa9, 0xe4, - 0x0b, 0x01, 0xc6, 0x2b, 0x34, 0x09, 0xa8, 0x68, - 0x13, 0x19, 0x04, 0xff, 0x18, 0x6a, 0x84, 0x64, - 0x9f, 0x09, 0x23, 0x5e, 0x9b, 0x26, 0x71, 0xa2, - 0x8d, 0xe4, 0x0a, 0xfd, 0x6b, 0xa8, 0x8c, 0xe6, - 0xf8, 0x92, 0x98, 0x31, 0x55, 0xc9, 0x11, 0x6c, - 0x23, 0x2e, 0xe4, 0x0f, 0xd3, 0x88, 0xca, 0xf9, - 0xbe, 0x2e, 0x48, 0x4c, 0xe3, 0xab, 0x22, 0xdc, - 0x5a, 0x14, 0xc8, 0x1f, 0x86, 0xae, 0x91, 0xb3,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x3a, 0xec, 0xbc, 0x3d, 0xa8, 0xea, 0x45, - 0xa0, 0x9c, 0x41, 0xfe, 0x18, 0xec, 0x27, 0x92, - 0xe1, 0x0b, 0x36, 0xd1, 0x0c, 0x4d, 0x99, 0x11, - 0xa2, 0xcd, 0x46, 0xdb, 0xbc, 0x44, 0x3d, 0xb8, - 0x67, 0x81, 0x9e, 0x80, 0xc0, 0x23, 0xd8, 0xef, - 0x56, 0xb2, 0xd6, 0x08, 0xc2, 0x8b, 0x68, 0xf1, - 0xbf, 0xf3, 0xdc, 0x69, 0xa0, 0x64, 0x6f, 0x9c, - 0x0d, 0x1c, 0x18, 0x8d, 0x80, 0x34, 0x30, 0x90, - 0xc6, 0x38, 0x10, 0x03, 0xe1, 0xba, 0xc1, 0x21, - 0x1a, 0x22, 0x3e, 0xa4, 0xd1, 0x85, 0xa7, 0x57, - 0x1c, 0x6a, 0xb2, 0x9f, 0xe9, 0xf1, 0x84, 0xe8, - 0x82, 0x0d, 0x46, 0x6c, 0xaf, 0x6c, 0x41, 0x26, - 0xb9, 0x6e, 0x32, 0xd6, 0x29, 0x30, 0x11, 0x12, - 0x46, 0x49, 0x02, 0xfc, 0xb6, 0x4e, 0x2c, 0x3c, - 0xd0, 0xd4, 0x36, 0x03, 0x89, 0xb9, 0x60, 0x61, - 0xfb, 0x8d, 0x19, 0xda, 0xaa, 0x36, 0xd1, 0xe6, - 0x54, 0x61, 0x4c, 0x92, 0xdb, 0x8f, 0x1a, 0xa8, - 0x1b, 0x3d, 0x34, 0x66, 0xf8, 0xff, 0x7e, 0x96, - 0x3b, 0x9c, 0x2e, 0x9f, 0xff, 0x62, 0xfc, 0x70, - 0x1d, 0x8f, 0x23, 0x82, 0xc6, 0x93, 0x9a, 0xe5, - 0x09, 0xb2, 0xbd, 0x74, 0x39, 0x73, 0xfa, 0xda, - 0xaa, 0x84, 0x07, 0x0e, 0x15, 0x85, 0xdd, 0x23, - 0xf6, 0xbf, 0xbb, 0x83, 0x7d, 0xe8, 0x9b, 0x6c, - 0x3e, 0xee, 0x57, 0xdd, 0xc9, 0xdd, 0x68, 0x49, - 0xf2, 0x28, 0x72, 0x69, 0xeb, 0xb6, 0xb9, 0x8c, - 0x62, 0xf2, 0x97, 0x7e, 0xaf, 0x40, 0x6c, 0x35, - 0x48, 0xda, 0x4a, 0xde, 0xec, 0x2c, 0xee, 0x1c, - 0x9a, 0x72, 0xc8, 0x92, 0x3c, 0x47, 0x29, 0xf6, - 0x5d, 0xff, 0x35, 0x8d, 0xa0, 0x47, 0x45, 0x0c, - 0xbb, 0x6a, 0x18, 0xd8, 0x6d, 0xce, 0xa5, 0xcd, - 0x37, 0x05, 0x4a, 0x54, 0xee, 0x63, 0x29, 0x91, - 0xfb, 0x30, 0xd7, 0xb4, 0x61, 0xbd, 0xd7, 0xc1, - 0x82, 0x56, 0x15, 0xdd, 0xa1, 0x90, 0x18, 0x4f, - 0x7b, 0xc3, 0x6c, 0x6e, 0xce, 0x63, 0x93, 0xa9, - 0x88, 0x69, 0x1c, 0xf7, 0x52, 0x03, 0x1f, 0x2c, - 0x86, 0xa3, 0xcb, 0x3c, 0xac, 0xc4, 0x49, 0xe5, - 0x6b, 0xa0, 0xdd, 0x75, 0xc1, 0x46, 0x88, 0xce, - 0x1e, 0x46, 0x8a, 0x9e, 0x3c, 0xcd, 0xf2, 0xdf, - 0x17, 0x90, 0xae, 0xed, 0x0b, 0x4b, 0x3e, 0xa7, - 0xf3, 0x0c, 0x4d, 0xb7, 0x02, 0x2b, 0x8a, 0xfe, - 0x20, 0x9c, 0x28, 0xcf, 0x7b, 0x41, 0x15, 0x85, - 0x62, 0x54, 0x45, 0x2a, 0xd2, 0xe6, 0x8d, 0x5a, - 0x2c, 0x1b, 0x8f, 0xf1, 0xd9, 0x9b, 0xee, 0x2c, - 0x9d, 0x2f, 0x66, 0x08, 0x6e, 0x74, 0x9d, 0x22, - 0x56, 0x40, 0x53, 0x21, 0xea, 0x8d, 0x11, 0x47, - 0xa0, 0xa1, 0x3b, 0xae, 0x83, 0xcc, 0x70, 0x4a, - 0x5a, 0x1e, 0x58, 0x6b, 0x77, 0xb1, 0x8a, 0x7b, - 0x04, 0xc3, 0xbf, 0x56, 0xef, 0x63, 0xa2, 0x42, - 0xf7, 0xfc, 0x38, 0x7c, 0xb4, 0xeb, 0x74, 0x18, - 0xd7, 0xf8, 0x7b, 0xbc, 0x92, 0x56, 0x85, 0x6c, - 0x58, 0x22, 0xc6, 0x2a, 0x78, 0x0a, 0xd3, 0x31, - 0x11, 0x89, 0x78, 0x0e, 0xdf, 0x67, 0x40, 0xa9, - 0x36, 0x37, 0x9e, 0x0d, 0xe3, 0x08, 0xf5, 0x5f, - 0x68, 0x94, 0x72, 0xb8, 0xd1, 0xac, 0xe1, 0x1e, - 0x06, 0xc6, 0x1e, 0x37, 0x56, 0x55, 0xed, 0xbf, - 0x6a, 0x30, 0x15, 0x4d, 0xfa, 0xaf, 0x54, 0x12, - 0x4f, 0x57, 0x5a, 0xfa, 0x8e, 0x14, 0xa7, 0x24, - 0x19, 0xcb, 0x7b, 0x51, 0xb3, 0x1d, 0xde, 0xed, - 0x64, 0x16, 0x3e, 0xab, 0xe9, 0xa6, 0xa5, 0x6b, - 0xdb, 0xca, 0xda, 0x22, 0x6d, 0x4e, 0x66, 0x4a, - 0xca, 0x7e, 0xe6, 0x1a, 0x67, 0xae, 0x4c, 0xdf, - 0x2c, 0xee, 0xf7, 0x51, 0x07, 0x76, 0x2f, 0xe3, - 0x5e, 0x9e, 0x81, 0x9f, 0xb5, 0x53, 0x98, 0xd8, - 0x9c, 0x7f, 0x0a, 0xd3, 0x59, 0x2d, 0xfc, 0x18, - 0xb3, 0x9b, 0x8d, 0x7f, 0x14, 0x27, 0x0b, 0x21, - 0x60, 0x9a, 0x2b, 0x57, 0x52, 0x66, 0x05, 0x7d, - 0x2a, 0x3d, 0xa1, 0xc6, 0x0f, 0xd1, 0x06, 0xfe, - 0xed, 0x52, 0xea, 0x25, 0xb5, 0x81, 0xaf, 0xfe, - 0xd7, 0x08, 0x0a, 0x7b, 0xdf, 0x59, 0xdd, 0xcf, - 0x83, 0xeb, 0x75, 0xf1, 0x26, 0xa9, 0x16, 0x1b, - 0x0b, 0xb7, 0xde, 0xb6, 0x52, 0xad, 0x47, 0xc5, - 0x59, 0x87, 0x1d, 0x71, 0x56, 0x08, 0xd6, 0x1c, - 0x4a, 0x5a, 0x73, 0xdc, 0x52, 0xef, 0x93, 0xd0, - 0x85, 0x3d, 0x13, 0xce, 0xd0, 0xe0, 0x51, 0x6b, - 0x23, 0x8b, 0xd5, 0x08, 0x1c, 0x18, 0x46, 0x51, - 0xb1, 0xe0, 0xd8, 0xa8, 0x94, 0x55, 0xc5, 0xf8, - 0x07, 0x58, 0x2a, 0xed, 0x0f, 0x52, 0xcc, 0xb7, - 0x46, 0xd7, 0x51, 0xa9, 0x7f, 0xab, 0xa1, 0x6c, - 0x5e, 0x42, 0x4f, 0x37, 0x74, 0xcc, 0x56, 0x27, - 0x13, 0xf1, 0x3e, 0xde, 0xed, 0xee, 0x30, 0xac, - 0x61, 0xe3, 0x63, 0xed, 0xd1, 0xd7, 0x0d, 0xe9, - 0x7b, 0x69, 0x27, 0xa9, 0x9e, 0xd3, 0x81, 0xa0, - 0x82, 0x81, 0xfa, 0xe4, 0x67, 0x36, 0x76, 0x70, - 0xac, 0xa1, 0x2a, 0x0f, 0x3f, 0xc9, 0xc6, 0xdf, - 0x03, 0x6f, 0x9a, 0x3d, 0xf2, 0xc6, 0xcd, 0x46, - 0xbb, 0x27, 0x06, 0x5b, 0xf4, 0x41, 0x8e, 0x7f, - 0x6e, 0x20, 0x2b, 0x8c, 0xfe, 0x06, 0x83, 0x55, - 0x6e, 0x1b, 0x9c, 0xab, 0x7c, 0x3c, 0x9a, 0x96, - 0x1e, 0x95, 0x53, 0x40, 0xec, 0x32, 0x46, 0x01, - 0x33, 0xc9, 0x1a, 0x15, 0xa0, 0x8c, 0xab, 0x0a, - 0x90, 0xaf, 0x48, 0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3, - 0x2d, 0x7f, 0x44, 0x71, 0xd7, 0x34, 0x48, 0xd2, - 0x5e, 0xb4, 0x3a, 0x8a, 0xd1, 0xb6, 0x83, 0x25, - 0x7e, 0x46, 0x71, 0xb7, 0xd8, 0xc9, 0xc6, 0x0a, - 0x11, 0xac, 0xb9, 0xab, 0xe5, 0x8b, 0xb4, 0x70, - 0x69, 0x2a, 0x92, 0x69, 0x82, 0x43, 0x27, 0x0a, - 0x04, 0xdc, 0x9e, 0x52, 0x21, 0x6e, 0x6f, 0x42, - 0x1d, 0x47, 0x12, 0x89, 0x8a, 0x4c, 0x18, 0x94, - 0x7c, 0x54, 0x9e, 0x3a, 0xc0, 0x40, 0xf0, 0x7c, - 0xc3, 0xfe, 0x38, 0x2a, 0x64, 0x9a, 0xcb, 0x50, - 0xdc, 0xe7, 0x55, 0x73, 0xd8, 0x59, 0x18, 0x20, - 0xe1, 0x82, 0xfa, 0x94, 0x48, 0x0e, 0x3b, 0xde, - 0x92, 0x67, 0x6a, 0xfa, 0x4d, 0x58, 0x6d, 0x79, - 0x07, 0x5a, 0x91, 0x30, 0x9f, 0x8d, 0xe3, 0x15, - 0xbd, 0x21, 0x48, 0xb6, 0x82, 0x1d, 0xb9, 0x0b, - 0x9a, 0xcb, 0x86, 0xdc, 0x67, 0xcd, 0xa5, 0x1b, - 0x08, 0xf2, 0x7d, 0x15, 0x74, 0xa5, 0x82, 0xae, - 0x64, 0x50, 0x53, 0x7d, 0x49, 0xb1, 0xbe, 0x44, - 0xad, 0x2f, 0x29, 0xa9, 0x2f, 0x51, 0xeb, 0x4b, - 0x0a, 0xf5, 0xdd, 0xf3, 0x22, 0x25, 0xef, 0x70, - 0x4f, 0xed, 0x24, 0x9f, 0x8f, 0xd1, 0x43, 0xdd, - 0x9c, 0xa4, 0x03, 0xa8, 0xd6, 0x93, 0x58, 0xea, - 0xd9, 0x42, 0x21, 0x5b, 0x73, 0xdb, 0xd1, 0xbe, - 0x0f, 0xc9, 0x56, 0x87, 0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0x1f, 0x77, 0xe8, 0x67, 0x82, 0x3e, - 0x5b, 0x6f, 0x3b, 0x9d, 0x90, 0x4e, 0x6f, 0xf5, - 0xd0, 0x22, 0x3f, 0x07, 0x4b, 0x18, 0x75, 0x92, - 0x80, 0x18, 0xc1, 0x62, 0x87, 0xc3, 0x1d, 0xfa, - 0xe2, 0x1f, 0x0c, 0x8a, 0xd1, 0xd4, 0x23, 0x19, - 0x98, 0xbb, 0x5c, 0xe6, 0x70, 0x38, 0x34, 0x9b, - 0xa2, 0xbe, 0x23, 0x07, 0x7a, 0xe1, 0xba, 0x0e, - 0x69, 0x7f, 0xd0, 0x7e, 0x73, 0xf8, 0xee, 0x08, - 0x02, 0xc0, 0x72, 0xa1, 0xe7, 0x8a, 0xea, 0xe5, - 0x92, 0x20, 0xb6, 0x41, 0xd8, 0x36, 0x74, 0x01, - 0xe8, 0x42, 0x54, 0x53, 0x92, 0x25, 0x3a, 0xa1, - 0x5e, 0x84, 0x02, 0x8c, 0xbe, 0x84, 0x91, 0x84, - 0x84, 0xa0, 0xc3, 0xb0, 0xaa, 0xfd, 0x10, 0xc1, - 0xdd, 0x8e, 0xda, 0x7f, 0x24, 0x08, 0x2f, 0x62, - 0x35, 0x16, 0x64, 0xaa, 0x5b, 0x77, 0x0c, 0xa9, - 0x1e, 0x69, 0x9e, 0x93, 0xd7, 0x31, 0x1b, 0x78, - 0xb3, 0xec, 0xc6, 0x21, 0xe3, 0x15, 0xb4, 0x8f, - 0x5b, 0xf4, 0x24, 0xa8, 0x0f, 0x2d, 0x41, 0x83, - 0x81, 0x3e, 0xde, 0xbf, 0xf3, 0xcd, 0x2d, 0x02, - 0x5a, 0x71, 0xc8, 0xdd, 0x2e, 0x1d, 0xcc, 0x3a, - 0xed, 0x39, 0x36, 0xb6, 0x32, 0x95, 0xf2, 0x72, - 0xd2, 0x9c, 0x53, 0xf4, 0x50, 0xd7, 0xa1, 0x8c, - 0x9d, 0x66, 0xbb, 0x74, 0x60, 0x29, 0xe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 0xcc, 0x64, 0xca, - 0xe8, 0xc5, 0x71, 0x6c, 0x64, 0x38, 0x52, 0x06, - 0xd2, 0xc9, 0x41, 0x1b, 0x0e, 0x94, 0x24, 0x76, - 0x16, 0x58, 0x21, 0x35, 0x78, 0xd7, 0x7e, 0x8f, - 0xa3, 0x77, 0x61, 0x24, 0x75, 0x5a, 0x51, 0xc9, - 0xab, 0x4a, 0xda, 0xcb, 0x71, 0x4a, 0xe8, 0xaa, - 0x2a, 0xba, 0x80, 0xbd, 0x9b, 0x75, 0xd6, 0xb9, - 0xcd, 0x90, 0x70, 0x2e, 0x3c, 0xaf, 0x12, 0x2f, - 0x71, 0x3a, 0xf9, 0x46, 0xca, 0xec, 0xe9, 0x38, - 0xbd, 0x06, 0xfd, 0x73, 0xea, 0xd0, 0x48, 0xcf, - 0x48, 0x08, 0xf8, 0x74, 0xd9, 0x19, 0xc5, 0x0b, - 0x16, 0x52, 0x03, 0x87, 0xda, 0x2d, 0xf2, 0x15, - 0x91, 0x60, 0x1e, 0x0e, 0x10, 0xc7, 0x1f, 0xa0, - 0xc2, 0x81, 0x20, 0xe7, 0x75, 0xfc, 0x67, 0x40, - 0x1f, 0xaf, 0xc2, 0x1f, 0x09, 0xf9, 0x20, 0xff, - 0xba, 0x01, 0xd2, 0xf6, 0x91, 0x6a, 0x56, 0x78, - 0x8f, 0xa5, 0x7c, 0xb0, 0xb0, 0xa6, 0x2f, 0x11, - 0x0d, 0x7d, 0x52, 0xc7, 0x96, 0x42, 0x83, 0x16, - 0x44, 0xa6, 0x0c, 0xff, 0xb9, 0xc2, 0xaa, 0x2f, - 0x53, 0x9b, 0x13, 0x6b, 0xd9, 0x96, 0xad, 0x48, - 0xcf, 0x5a, 0x64, 0x6d, 0x6d, 0xfd, 0x2a, 0x94, - 0xb6, 0x94, 0x22, 0xa9, 0xa1, 0x88, 0x9c, 0x7f, - 0x59, 0x81, 0x1a, 0x15, 0xe3, 0xa0, 0x0a, 0x11, - 0x66, 0xfa, 0x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0xa5, 0x10, 0x4f, 0x89, 0x97, 0x22, 0x81, - 0x2e, 0x2f, 0x70, 0xd3, 0x79, 0x31, 0xdc, 0x14, - 0x90, 0x17, 0x68, 0x1c, 0xd0, 0x64, 0xc7, 0x5e, - 0x6b, 0xdc, 0x3b, 0x64, 0x24, 0x02, 0x91, 0xca, - 0x90, 0x92, 0x0c, 0xd7, 0x63, 0xdf, 0x10, 0x33, - 0x18, 0x0a, 0x30, 0xb2, 0x31, 0xc3, 0xe0, 0xf1, - 0x92, 0x2a, 0x64, 0x9b, 0xcc, 0x38, 0x93, 0x6e, - 0x46, 0xe3, 0x81, 0x22, 0x29, 0xa0, 0x78, 0x91, - 0x5f, 0xd4, 0xb3, 0x21, 0x9a, 0xd5, 0x29, 0x3a, - 0x77, 0x80, 0x85, 0x49, 0x44, 0x19, 0xd0, 0xf1, - 0x1d, 0x32, 0x36, 0x75, 0xda, 0x5f, 0x6e, 0x70, - 0x7e, 0x86, 0x65, 0x89, 0xe0, 0x26, 0x12, 0xa2, - 0x1a, 0x0a, 0xd1, 0x9a, 0xc9, 0xcb, 0x60, 0x64, - 0x26, 0xf8, 0x12, 0xf3, 0xfb, 0x18, 0x08, 0xa9, - 0x2a, 0x88, 0x93, 0x65, 0xe2, 0xcb, 0x89, 0x52, - 0xe4, 0x90, 0xdc, 0x42, 0xc2, 0x8a, 0x52, 0xc5, - 0xcd, 0xd8, 0xad, 0x4b, 0x9f, 0xf7, 0x13, 0x6e, - 0x7c, 0x4a, 0x9e, 0x7c, 0xf9, 0xed, 0xec, 0xe4, - 0x97, 0xb3, 0x93, 0x8b, 0xb3, 0x2f, 0x3f, 0xd7, - 0x2c, 0x0f, 0x04, 0x20, 0x82, 0x39, 0x3c, 0x6e, - 0x19, 0x0e, 0xfa, 0x7c, 0xfc, 0xee, 0xed, 0x61, - 0xab, 0xfd, 0xe6, 0xa0, 0xb0, 0xc3, 0x07, 0x56, - 0x13, 0x71, 0x58, 0x15, 0x77, 0xff, 0x70, 0x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0x8a, 0xf1, 0xed, 0x94, 0x88, - 0x04, 0x36, 0x27, 0xef, 0x41, 0xe0, 0xa0, 0x95, - 0xa0, 0xa8, 0x84, 0xd2, 0x12, 0x15, 0xf1, 0x58, - 0xe2, 0x04, 0x08, 0x5c, 0x01, 0x6e, 0x9d, 0x7e, - 0xdd, 0x78, 0x6f, 0x8e, 0x68, 0x3c, 0x74, 0xe1, - 0x61, 0x95, 0x17, 0x6d, 0xf0, 0xdd, 0x2a, 0xb3, - 0x97, 0x6f, 0x08, 0x4b, 0x30, 0xe0, 0xbf, 0xa5, - 0xbf, 0xe9, 0x36, 0x64, 0xc8, 0xc7, 0x97, 0xfd, - 0x00, 0xbd, 0x81, 0x19, 0xbb, 0xf1, 0xf8, 0x92, - 0x64, 0x8a, 0x1c, 0x3a, 0x1a, 0x40, 0xbc, 0x47, - 0x07, 0x84, 0x69, 0xb5, 0x90, 0xce, 0xb0, 0xd4, - 0x1d, 0xf6, 0x8b, 0xeb, 0xc1, 0x8a, 0xce, 0x02, - 0x56, 0x2a, 0x57, 0xee, 0xb2, 0xab, 0x5c, 0x29, - 0xcb, 0xeb, 0xf5, 0x8a, 0x58, 0x3a, 0xf8, 0xc5, - 0x0a, 0x50, 0x8c, 0xea, 0x8e, 0xa0, 0x8f, 0xea, - 0xe6, 0xe4, 0x39, 0x0b, 0xb9, 0x22, 0x57, 0xed, - 0x14, 0x7c, 0x49, 0x94, 0x54, 0xe7, 0x89, 0xd8, - 0x99, 0x44, 0x83, 0xd0, 0xe4, 0x1a, 0x56, 0xa4, - 0xa5, 0x01, 0xd4, 0xf2, 0x73, 0xe2, 0xbe, 0x44, - 0x0a, 0xe9, 0x95, 0x56, 0x07, 0xe9, 0x95, 0x4e, - 0x44, 0xfe, 0xea, 0xd5, 0x78, 0x6c, 0x53, 0x10, - 0x29, 0xd3, 0x39, 0x04, 0xb2, 0x6e, 0x5c, 0xf9, - 0x57, 0xf0, 0x6a, 0xbb, 0xf6, 0xa4, 0x17, 0x63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, - 0xab, 0x78, 0x7c, 0x01, 0x97, 0xf1, 0xea, 0x38, - 0xaa, 0xd4, 0x37, 0x67, 0x24, 0xae, 0xf9, 0xca, - 0x38, 0xf1, 0x01, 0x3f, 0xe0, 0xfb, 0x13, 0x2f, - 0xd8, 0x03, 0x5c, 0xe9, 0xc4, 0x0e, 0x1d, 0x2c, - 0xf2, 0x6c, 0x75, 0x5c, 0x50, 0xf0, 0x50, 0xef, - 0x77, 0x57, 0x52, 0xba, 0xa9, 0x54, 0x62, 0x29, - 0x95, 0x3c, 0xd2, 0xe9, 0x20, 0x9a, 0x0a, 0x95, - 0xc4, 0xa6, 0xc4, 0x64, 0x1b, 0xa5, 0x70, 0x7f, - 0xdf, 0x65, 0x7f, 0x7a, 0x69, 0x7f, 0x7a, 0xa9, - 0xdc, 0x2d, 0xce, 0x86, 0xcc, 0xe0, 0x33, 0x7b, - 0x08, 0x97, 0x39, 0x76, 0x14, 0x95, 0x50, 0x29, - 0xf2, 0xad, 0x7d, 0x25, 0x40, 0x4c, 0xfc, 0x25, - 0xe5, 0x96, 0xf5, 0xa6, 0x0a, 0xb6, 0xbf, 0xbc, - 0xb3, 0x3f, 0xf8, 0xf5, 0x4c, 0x0e, 0x7e, 0xed, - 0xce, 0xb7, 0x2d, 0x4d, 0x45, 0xf1, 0xd3, 0x50, - 0xb3, 0xc8, 0xf4, 0xd5, 0xf9, 0x69, 0x6a, 0xb2, - 0x8c, 0xc9, 0x38, 0xc9, 0xf6, 0x2e, 0xe8, 0xbd, - 0x0b, 0x7a, 0xef, 0x82, 0x7e, 0x85, 0x2e, 0x68, - 0xac, 0xaa, 0x47, 0x54, 0x66, 0xf0, 0x79, 0xe9, - 0xe9, 0xd6, 0x47, 0x73, 0x19, 0x48, 0x02, 0x85, - 0x8f, 0x5f, 0x01, 0x6c, 0x55, 0xe7, 0x86, 0x89, - 0x4b, 0xb1, 0x27, 0x6b, 0xb1, 0x27, 0xd5, 0xb0, - 0x27, 0x12, 0x76, 0x88, 0x6e, 0x56, 0xcd, 0x4d, - 0xbe, 0x3e, 0x34, 0xd7, 0xa2, 0x7f, 0x89, 0xbb, - 0xb5, 0x18, 0x63, 0x09, 0x59, 0x6c, 0xcf, 0xcc, - 0x0a, 0xda, 0xdf, 0xe2, 0x2a, 0x5f, 0x87, 0x77, - 0xa7, 0x07, 0x3f, 0xae, 0x12, 0xfb, 0x12, 0x2f, - 0x94, 0x19, 0x31, 0x94, 0x1c, 0x04, 0x28, 0xf6, - 0x78, 0x69, 0x87, 0x6f, 0xa0, 0xae, 0xbc, 0x40, - 0xff, 0x28, 0x12, 0x42, 0x90, 0xdb, 0x8d, 0x8d, - 0xd1, 0x88, 0xb0, 0x28, 0x71, 0x9b, 0xb1, 0x06, - 0x9c, 0x58, 0x81, 0x93, 0x02, 0x30, 0x76, 0xe5, - 0xf1, 0x5a, 0x7c, 0x8e, 0xc2, 0xc7, 0x72, 0xce, - 0x0d, 0x89, 0x63, 0x2e, 0x52, 0xde, 0x97, 0x3d, - 0x6e, 0x08, 0xe9, 0x28, 0x4b, 0x68, 0x12, 0x50, - 0xd8, 0x94, 0x43, 0xd1, 0x3e, 0xfe, 0xf1, 0xcf, - 0x4a, 0x27, 0x2c, 0xf3, 0x31, 0x5a, 0x41, 0xe6, - 0xf2, 0x63, 0x14, 0x5c, 0xe6, 0xe3, 0x15, 0xc5, - 0x92, 0x99, 0x5c, 0x5d, 0x5e, 0xa6, 0xf3, 0xb2, - 0x87, 0x67, 0x37, 0x0c, 0xc3, 0xd5, 0x32, 0xa4, - 0xb5, 0xb7, 0x8d, 0xcd, 0xd5, 0x8a, 0x1c, 0xc7, - 0x1c, 0xbb, 0xb0, 0x01, 0x27, 0x6f, 0x03, 0x95, - 0xfe, 0x9a, 0x0b, 0x51, 0x86, 0x48, 0xc9, 0x76, - 0x44, 0x42, 0xb9, 0xc1, 0x03, 0xe7, 0x72, 0x07, - 0x40, 0xf8, 0x29, 0xd1, 0x55, 0x52, 0xe7, 0xca, - 0x7b, 0xc9, 0xdd, 0xdc, 0x1a, 0xd3, 0xd2, 0xba, - 0xd4, 0xb6, 0xec, 0x59, 0xed, 0xca, 0xdd, 0x54, - 0x18, 0x9d, 0x39, 0xc4, 0x40, 0x42, 0xaa, 0xc4, - 0x02, 0x22, 0x72, 0x97, 0x65, 0x83, 0xb0, 0x2c, - 0x8e, 0x7c, 0x8c, 0xba, 0x0d, 0x87, 0x83, 0xd3, - 0xdf, 0x37, 0x61, 0x10, 0xbd, 0x6c, 0x9a, 0xcf, - 0xe3, 0x85, 0xe9, 0xfd, 0x13, 0x78, 0xa9, 0x64, - 0x31, 0x1b, 0x4d, 0xbb, 0x37, 0x38, 0x0a, 0xaf, - 0x76, 0xa4, 0x5c, 0x88, 0xe5, 0x56, 0x71, 0x62, - 0xb6, 0x48, 0x50, 0xb1, 0xd6, 0x9a, 0x30, 0xb1, - 0x6d, 0x02, 0xd6, 0x26, 0xd1, 0xb8, 0x09, 0xb2, - 0x66, 0x4c, 0x54, 0x7f, 0x54, 0x05, 0x4d, 0x98, - 0x0f, 0x92, 0x48, 0xfc, 0x0c, 0x18, 0x58, 0x78, - 0xc7, 0x0b, 0xb5, 0xf5, 0x42, 0x6d, 0x51, 0xa8, - 0x2d, 0x0a, 0xb5, 0xa1, 0x90, 0xe6, 0xef, 0x27, - 0xd8, 0x7c, 0x1a, 0x05, 0x96, 0x8d, 0x3e, 0x7d, - 0x54, 0xa9, 0x89, 0x64, 0x84, 0x14, 0xcd, 0x14, - 0xba, 0x84, 0xe3, 0x05, 0xb4, 0x21, 0x7c, 0xe1, - 0x68, 0xda, 0x10, 0xc9, 0x1c, 0x7d, 0xf8, 0x6a, - 0x8f, 0x41, 0x84, 0x7f, 0xd7, 0xb7, 0xe4, 0xdd, - 0x2e, 0x57, 0xd6, 0xbc, 0xd5, 0xed, 0x92, 0xc7, - 0x45, 0x8b, 0xaf, 0x53, 0x24, 0x1d, 0xd2, 0x88, - 0xbd, 0x40, 0xc4, 0x9e, 0x95, 0x62, 0xef, 0x49, - 0xb9, 0xc1, 0x21, 0x84, 0xb1, 0x84, 0x08, 0xe1, - 0x0e, 0x85, 0x6d, 0xa0, 0x2f, 0x08, 0xdf, 0x55, - 0x1c, 0x7e, 0x20, 0x18, 0x2a, 0xc4, 0xb3, 0xc7, - 0x2b, 0x0c, 0x3f, 0x99, 0x3e, 0x64, 0xe8, 0x81, - 0xa1, 0xc0, 0xbe, 0x26, 0x0d, 0xd4, 0x59, 0xd1, - 0x5f, 0x9b, 0xe0, 0x32, 0x44, 0xe8, 0xb7, 0x05, - 0x0f, 0x54, 0xe1, 0x57, 0x48, 0xd1, 0x24, 0x2c, - 0x96, 0x14, 0x24, 0x5e, 0x18, 0x23, 0xd2, 0xe7, - 0xd5, 0xf8, 0xb8, 0xed, 0x74, 0xf8, 0x7c, 0x16, - 0xe2, 0xeb, 0x7e, 0xf2, 0x17, 0xf5, 0xd2, 0x22, - 0xa7, 0x53, 0xe6, 0xfc, 0x2c, 0x2a, 0x04, 0xdb, - 0x0b, 0x8d, 0x5b, 0x26, 0xd4, 0x5a, 0x36, 0x6f, - 0x99, 0x28, 0xa9, 0x87, 0x50, 0x82, 0xdb, 0x49, - 0xaa, 0xcc, 0xe5, 0x5e, 0x47, 0x60, 0x4c, 0x5d, - 0x08, 0x25, 0x59, 0x36, 0x06, 0x21, 0xb3, 0x20, - 0x1b, 0x6d, 0x10, 0xe8, 0xb1, 0x8b, 0x89, 0x8d, - 0x25, 0x49, 0xaf, 0x01, 0x5d, 0xa6, 0x31, 0x96, - 0xa5, 0x05, 0x38, 0xf5, 0x05, 0x3e, 0x0c, 0x5b, - 0x96, 0x69, 0xc9, 0xea, 0xc5, 0x13, 0xc4, 0x83, - 0x60, 0xc8, 0x41, 0xd0, 0x35, 0x24, 0x99, 0xd9, - 0x3b, 0x08, 0x16, 0xf8, 0xd9, 0x28, 0xef, 0x0d, - 0x75, 0x5a, 0xe7, 0x59, 0x1e, 0xe7, 0x69, 0x77, - 0xb1, 0x9a, 0x24, 0xd9, 0xd8, 0x52, 0x90, 0x84, - 0x98, 0xd3, 0x76, 0x93, 0x14, 0x21, 0xde, 0x1b, - 0xe2, 0x08, 0x8c, 0x2f, 0x60, 0xf7, 0x60, 0xcd, - 0x06, 0x1a, 0x49, 0x1d, 0xc7, 0x49, 0x8a, 0x16, - 0xae, 0x71, 0x3c, 0x4d, 0x2d, 0x10, 0x03, 0xf6, - 0x7a, 0x83, 0x96, 0x2d, 0x38, 0x00, 0x44, 0xb0, - 0x9e, 0x8c, 0x47, 0x80, 0x98, 0xcb, 0x93, 0x78, - 0x16, 0x5a, 0x8e, 0x5c, 0x15, 0x4d, 0xbb, 0x82, - 0x61, 0xa7, 0xb0, 0xe8, 0x33, 0x79, 0x79, 0x5c, - 0xe8, 0x31, 0x91, 0x3c, 0x2b, 0xf9, 0x49, 0x13, - 0xe6, 0x1d, 0x55, 0x73, 0xd9, 0x39, 0x15, 0xac, - 0x79, 0x08, 0x0f, 0x20, 0x4b, 0x84, 0x0e, 0x61, - 0xa9, 0x08, 0x54, 0xe6, 0xcb, 0x45, 0x3a, 0x98, - 0x40, 0xb0, 0x41, 0xc4, 0x79, 0xe3, 0x34, 0x6a, - 0x68, 0xf3, 0xfa, 0xaf, 0xce, 0x77, 0xa6, 0xa8, - 0x42, 0x9f, 0xc2, 0x02, 0xf6, 0x83, 0x65, 0xfa, - 0xc2, 0x3b, 0x23, 0x3f, 0xd8, 0x67, 0x2d, 0xea, - 0x54, 0x4c, 0x05, 0x88, 0x41, 0x42, 0xd0, 0x5f, - 0xad, 0xef, 0x3e, 0xfd, 0xd5, 0xfe, 0xee, 0xb3, - 0x09, 0xec, 0x06, 0x38, 0x6e, 0x71, 0x78, 0x57, - 0x83, 0x3e, 0xab, 0x41, 0x8d, 0xf7, 0xab, 0x90, - 0x57, 0x56, 0x44, 0x5c, 0xd6, 0x94, 0xf5, 0x88, - 0xa9, 0x54, 0xa1, 0xf8, 0xd4, 0x34, 0xd5, 0x57, - 0x76, 0x9e, 0x8d, 0xa6, 0xf9, 0xba, 0x10, 0xda, - 0x34, 0x12, 0x32, 0x97, 0x46, 0x48, 0x04, 0x0d, - 0x33, 0x21, 0x8d, 0x22, 0x15, 0x5b, 0x53, 0x1d, - 0x45, 0x06, 0x45, 0xa4, 0x4b, 0xa4, 0xcf, 0x91, - 0xda, 0x4f, 0x07, 0x56, 0xc4, 0x41, 0x89, 0x08, - 0xac, 0x7d, 0x38, 0x28, 0xc9, 0x0d, 0xac, 0x38, - 0x15, 0xda, 0x24, 0x97, 0x16, 0x25, 0x8f, 0x98, - 0x65, 0x60, 0xa7, 0x80, 0x0b, 0x53, 0xa5, 0x1d, - 0x9b, 0x5e, 0xe0, 0x59, 0x0e, 0xa1, 0x27, 0xbd, - 0xa8, 0x50, 0x9a, 0x9d, 0x8b, 0x42, 0x8a, 0x00, - 0x3b, 0xff, 0x44, 0xe5, 0x44, 0xed, 0x27, 0xcc, - 0xa5, 0x41, 0xe7, 0x08, 0x7b, 0x59, 0xf1, 0x48, - 0x28, 0xac, 0x8e, 0xa5, 0x33, 0x91, 0xd5, 0xa0, - 0xc9, 0xa3, 0x9a, 0x42, 0xc2, 0x5f, 0x8a, 0xf8, - 0x66, 0xba, 0x22, 0x99, 0x5a, 0xe7, 0x6b, 0x07, - 0x91, 0xc4, 0x5e, 0x6e, 0xe3, 0x90, 0xd0, 0xfc, - 0x5d, 0x9e, 0x58, 0x1f, 0xaf, 0xe5, 0x2a, 0x28, - 0x8c, 0x20, 0x86, 0x4c, 0x22, 0x53, 0x45, 0x00, - 0x6f, 0x4c, 0xbf, 0x09, 0xf5, 0x66, 0xe0, 0xf8, - 0xb1, 0x0e, 0x9c, 0x9d, 0xc2, 0x07, 0xb4, 0xd4, - 0x85, 0xc6, 0x87, 0xe3, 0x57, 0x70, 0xc6, 0x2b, - 0xbc, 0x93, 0xbb, 0x02, 0xcf, 0x76, 0xc4, 0xab, - 0xd3, 0x08, 0x87, 0x29, 0x95, 0x65, 0x40, 0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e6, - 0xd9, 0x4c, 0x9f, 0x2f, 0xe3, 0x8c, 0xcd, 0x54, - 0x72, 0x10, 0xcf, 0x74, 0x78, 0x40, 0xb1, 0x2e, - 0x8a, 0x74, 0x3a, 0x4c, 0xfc, 0xb2, 0x3a, 0xd6, - 0x07, 0x59, 0xe2, 0x4a, 0x96, 0xcc, 0xac, 0xf1, - 0x34, 0x53, 0xe8, 0xd8, 0x15, 0x75, 0x1a, 0x11, - 0xb4, 0x81, 0x8c, 0x84, 0x34, 0xa4, 0x32, 0xfb, - 0x61, 0xe2, 0x22, 0x21, 0x0a, 0x03, 0x87, 0xe3, - 0xf7, 0x14, 0xd6, 0x74, 0x43, 0xf9, 0x4c, 0xe5, - 0xd5, 0xe5, 0x65, 0xe4, 0x60, 0x55, 0xb9, 0x81, - 0xef, 0x2d, 0x50, 0xb5, 0x99, 0x2b, 0xe2, 0xd0, - 0x3f, 0xec, 0x30, 0x4e, 0x24, 0xb1, 0x00, 0xa9, - 0xce, 0xe1, 0xdd, 0xe7, 0xb5, 0x9b, 0xed, 0xf7, - 0x01, 0x11, 0xce, 0x75, 0x41, 0x85, 0x5b, 0x42, - 0x06, 0xa9, 0x1b, 0x6a, 0x16, 0xa3, 0x19, 0x88, - 0x05, 0x95, 0x22, 0x0b, 0xef, 0x24, 0x72, 0xf1, - 0x91, 0x40, 0x93, 0xbf, 0x18, 0xbc, 0xc5, 0xcd, - 0xb8, 0xd8, 0x21, 0xa4, 0xae, 0x7e, 0x84, 0x3f, - 0x3c, 0x79, 0x82, 0x2a, 0x6a, 0x0e, 0xf6, 0x55, - 0x4b, 0x87, 0x08, 0x81, 0xb4, 0x86, 0x8c, 0xc0, - 0x87, 0x94, 0xba, 0x92, 0x52, 0xf1, 0xc4, 0xa0, - 0xa7, 0xae, 0x64, 0xf7, 0xf2, 0x65, 0xff, 0x1f, - 0x03, 0x90, 0xfe, 0x1c - }; - static std::string decompressed = util::decompress(std::string(reinterpret_cast(compressed), sizeof(compressed))); - return decompressed.c_str(); -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/source.hpp b/src/mbgl/shaders/source.hpp deleted file mode 100644 index 38a5ea6ece..0000000000 --- a/src/mbgl/shaders/source.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -const char* source(); - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/symbol_icon.cpp b/src/mbgl/shaders/symbol_icon.cpp deleted file mode 100644 index 7e10f23aa2..0000000000 --- a/src/mbgl/shaders/symbol_icon.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* symbol_icon::name = "symbol_icon"; -const char* symbol_icon::vertexSource = source() + 50000; -const char* symbol_icon::fragmentSource = source() + 52654; - -// Uncompressed source of symbol_icon.vertex.glsl: -/* -const float PI = 3.141592653589793; - -attribute vec4 a_pos_offset; -attribute vec4 a_data; -attribute vec3 a_projected_pos; -attribute float a_fade_opacity; - -uniform bool u_is_size_zoom_constant; -uniform bool u_is_size_feature_constant; -uniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function -uniform highp float u_size; // used when size is both zoom and feature constant -uniform highp float u_camera_to_center_distance; -uniform highp float u_pitch; -uniform bool u_rotate_symbol; -uniform highp float u_aspect_ratio; -uniform float u_fade_change; - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -uniform mat4 u_matrix; -uniform mat4 u_label_plane_matrix; -uniform mat4 u_gl_coord_matrix; - -uniform bool u_is_text; -uniform bool u_pitch_with_map; - -uniform vec2 u_texsize; - -varying vec2 v_tex; -varying float v_fade_opacity; - -void main() { - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - - vec2 a_pos = a_pos_offset.xy; - vec2 a_offset = a_pos_offset.zw; - - vec2 a_tex = a_data.xy; - vec2 a_size = a_data.zw; - - highp float segment_angle = -a_projected_pos[2]; - - float size; - if (!u_is_size_zoom_constant && !u_is_size_feature_constant) { - size = mix(a_size[0], a_size[1], u_size_t) / 256.0; - } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) { - size = a_size[0] / 256.0; - } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) { - size = u_size; - } else { - size = u_size; - } - - vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1); - highp float camera_to_anchor_distance = projectedPoint.w; - // See comments in symbol_sdf.vertex - highp float distance_ratio = u_pitch_with_map ? - camera_to_anchor_distance / u_camera_to_center_distance : - u_camera_to_center_distance / camera_to_anchor_distance; - highp float perspective_ratio = clamp( - 0.5 + 0.5 * distance_ratio, - 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles - 4.0); - - size *= perspective_ratio; - - float fontScale = u_is_text ? size / 24.0 : size; - - highp float symbol_rotation = 0.0; - if (u_rotate_symbol) { - // See comments in symbol_sdf.vertex - vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1); - - vec2 a = projectedPoint.xy / projectedPoint.w; - vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w; - - symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x); - } - - highp float angle_sin = sin(segment_angle + symbol_rotation); - highp float angle_cos = cos(segment_angle + symbol_rotation); - mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); - - vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); - gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); - - v_tex = a_tex / u_texsize; - vec2 fade_opacity = unpack_opacity(a_fade_opacity); - float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change; - v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change)); -} - -*/ - -// Uncompressed source of symbol_icon.fragment.glsl: -/* -uniform sampler2D u_texture; - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -varying vec2 v_tex; -varying float v_fade_opacity; - -void main() { - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - - lowp float alpha = opacity * v_fade_opacity; - gl_FragColor = texture2D(u_texture, v_tex) * alpha; - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/symbol_icon.hpp b/src/mbgl/shaders/symbol_icon.hpp deleted file mode 100644 index eccf17602d..0000000000 --- a/src/mbgl/shaders/symbol_icon.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class symbol_icon { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/symbol_sdf.cpp b/src/mbgl/shaders/symbol_sdf.cpp deleted file mode 100644 index 1ffc4c338c..0000000000 --- a/src/mbgl/shaders/symbol_sdf.cpp +++ /dev/null @@ -1,311 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#include -#include - -namespace mbgl { -namespace shaders { - -const char* symbol_sdf::name = "symbol_sdf"; -const char* symbol_sdf::vertexSource = source() + 53059; -const char* symbol_sdf::fragmentSource = source() + 57099; - -// Uncompressed source of symbol_sdf.vertex.glsl: -/* -const float PI = 3.141592653589793; - -attribute vec4 a_pos_offset; -attribute vec4 a_data; -attribute vec3 a_projected_pos; -attribute float a_fade_opacity; - -// contents of a_size vary based on the type of property value -// used for {text,icon}-size. -// For constants, a_size is disabled. -// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature. -// For composite functions: -// [ text-size(lowerZoomStop, feature), -// text-size(upperZoomStop, feature) ] -uniform bool u_is_size_zoom_constant; -uniform bool u_is_size_feature_constant; -uniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function -uniform highp float u_size; // used when size is both zoom and feature constant - - -#ifndef HAS_UNIFORM_u_fill_color -uniform lowp float a_fill_color_t; -attribute highp vec4 a_fill_color; -varying highp vec4 fill_color; -#else -uniform highp vec4 u_fill_color; -#endif - - -#ifndef HAS_UNIFORM_u_halo_color -uniform lowp float a_halo_color_t; -attribute highp vec4 a_halo_color; -varying highp vec4 halo_color; -#else -uniform highp vec4 u_halo_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -uniform lowp float a_opacity_t; -attribute lowp vec2 a_opacity; -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_halo_width -uniform lowp float a_halo_width_t; -attribute lowp vec2 a_halo_width; -varying lowp float halo_width; -#else -uniform lowp float u_halo_width; -#endif - - -#ifndef HAS_UNIFORM_u_halo_blur -uniform lowp float a_halo_blur_t; -attribute lowp vec2 a_halo_blur; -varying lowp float halo_blur; -#else -uniform lowp float u_halo_blur; -#endif - - -uniform mat4 u_matrix; -uniform mat4 u_label_plane_matrix; -uniform mat4 u_gl_coord_matrix; - -uniform bool u_is_text; -uniform bool u_pitch_with_map; -uniform highp float u_pitch; -uniform bool u_rotate_symbol; -uniform highp float u_aspect_ratio; -uniform highp float u_camera_to_center_distance; -uniform float u_fade_change; - -uniform vec2 u_texsize; - -varying vec2 v_data0; -varying vec3 v_data1; - -void main() { - -#ifndef HAS_UNIFORM_u_fill_color - fill_color = unpack_mix_color(a_fill_color, a_fill_color_t); -#else - highp vec4 fill_color = u_fill_color; -#endif - - -#ifndef HAS_UNIFORM_u_halo_color - halo_color = unpack_mix_color(a_halo_color, a_halo_color_t); -#else - highp vec4 halo_color = u_halo_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity - opacity = unpack_mix_vec2(a_opacity, a_opacity_t); -#else - lowp float opacity = u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_halo_width - halo_width = unpack_mix_vec2(a_halo_width, a_halo_width_t); -#else - lowp float halo_width = u_halo_width; -#endif - - -#ifndef HAS_UNIFORM_u_halo_blur - halo_blur = unpack_mix_vec2(a_halo_blur, a_halo_blur_t); -#else - lowp float halo_blur = u_halo_blur; -#endif - - - vec2 a_pos = a_pos_offset.xy; - vec2 a_offset = a_pos_offset.zw; - - vec2 a_tex = a_data.xy; - vec2 a_size = a_data.zw; - - highp float segment_angle = -a_projected_pos[2]; - float size; - - if (!u_is_size_zoom_constant && !u_is_size_feature_constant) { - size = mix(a_size[0], a_size[1], u_size_t) / 256.0; - } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) { - size = a_size[0] / 256.0; - } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) { - size = u_size; - } else { - size = u_size; - } - - vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1); - highp float camera_to_anchor_distance = projectedPoint.w; - // If the label is pitched with the map, layout is done in pitched space, - // which makes labels in the distance smaller relative to viewport space. - // We counteract part of that effect by multiplying by the perspective ratio. - // If the label isn't pitched with the map, we do layout in viewport space, - // which makes labels in the distance larger relative to the features around - // them. We counteract part of that effect by dividing by the perspective ratio. - highp float distance_ratio = u_pitch_with_map ? - camera_to_anchor_distance / u_camera_to_center_distance : - u_camera_to_center_distance / camera_to_anchor_distance; - highp float perspective_ratio = clamp( - 0.5 + 0.5 * distance_ratio, - 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles - 4.0); - - size *= perspective_ratio; - - float fontScale = u_is_text ? size / 24.0 : size; - - highp float symbol_rotation = 0.0; - if (u_rotate_symbol) { - // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units - // To figure out that angle in projected space, we draw a short horizontal line in tile - // space, project it, and measure its angle in projected space. - vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1); - - vec2 a = projectedPoint.xy / projectedPoint.w; - vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w; - - symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x); - } - - highp float angle_sin = sin(segment_angle + symbol_rotation); - highp float angle_cos = cos(segment_angle + symbol_rotation); - mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos); - - vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0); - gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0); - float gamma_scale = gl_Position.w; - - vec2 tex = a_tex / u_texsize; - vec2 fade_opacity = unpack_opacity(a_fade_opacity); - float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change; - float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change)); - - v_data0 = vec2(tex.x, tex.y); - v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity); -} - -*/ - -// Uncompressed source of symbol_sdf.fragment.glsl: -/* -#define SDF_PX 8.0 -#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO - -uniform bool u_is_halo; - -#ifndef HAS_UNIFORM_u_fill_color -varying highp vec4 fill_color; -#else -uniform highp vec4 u_fill_color; -#endif - - -#ifndef HAS_UNIFORM_u_halo_color -varying highp vec4 halo_color; -#else -uniform highp vec4 u_halo_color; -#endif - - -#ifndef HAS_UNIFORM_u_opacity -varying lowp float opacity; -#else -uniform lowp float u_opacity; -#endif - - -#ifndef HAS_UNIFORM_u_halo_width -varying lowp float halo_width; -#else -uniform lowp float u_halo_width; -#endif - - -#ifndef HAS_UNIFORM_u_halo_blur -varying lowp float halo_blur; -#else -uniform lowp float u_halo_blur; -#endif - - -uniform sampler2D u_texture; -uniform highp float u_gamma_scale; -uniform bool u_is_text; - -varying vec2 v_data0; -varying vec3 v_data1; - -void main() { - -#ifdef HAS_UNIFORM_u_fill_color - highp vec4 fill_color = u_fill_color; -#endif - - -#ifdef HAS_UNIFORM_u_halo_color - highp vec4 halo_color = u_halo_color; -#endif - - -#ifdef HAS_UNIFORM_u_opacity - lowp float opacity = u_opacity; -#endif - - -#ifdef HAS_UNIFORM_u_halo_width - lowp float halo_width = u_halo_width; -#endif - - -#ifdef HAS_UNIFORM_u_halo_blur - lowp float halo_blur = u_halo_blur; -#endif - - - vec2 tex = v_data0.xy; - float gamma_scale = v_data1.x; - float size = v_data1.y; - float fade_opacity = v_data1[2]; - - float fontScale = u_is_text ? size / 24.0 : size; - - lowp vec4 color = fill_color; - highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale); - lowp float buff = (256.0 - 64.0) / 256.0; - if (u_is_halo) { - color = halo_color; - gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale); - buff = (6.0 - halo_width / fontScale) / SDF_PX; - } - - lowp float dist = texture2D(u_texture, tex).a; - highp float gamma_scaled = gamma * gamma_scale; - highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist); - - gl_FragColor = color * (alpha * opacity * fade_opacity); - -#ifdef OVERDRAW_INSPECTOR - gl_FragColor = vec4(1.0); -#endif -} - -*/ - -} // namespace shaders -} // namespace mbgl diff --git a/src/mbgl/shaders/symbol_sdf.hpp b/src/mbgl/shaders/symbol_sdf.hpp deleted file mode 100644 index d5761d5fdb..0000000000 --- a/src/mbgl/shaders/symbol_sdf.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// NOTE: DO NOT CHANGE THIS FILE. IT IS AUTOMATICALLY GENERATED. - -#pragma once - -namespace mbgl { -namespace shaders { - -class symbol_sdf { -public: - static const char* name; - static const char* vertexSource; - static const char* fragmentSource; -}; - -} // namespace shaders -} // namespace mbgl -- cgit v1.2.1