MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
debug.hpp
Go to the documentation of this file.
1 // Generated code, do not modify this file!
2 // Generated on 2023-04-05T16:25:15.886Z by mwilsnd using shaders/generate_shader_code.js
3 
4 #pragma once
6 
7 namespace mbgl {
8 namespace shaders {
9 
11  static constexpr const char* vertex = R"(layout (location = 0) in vec2 a_pos;
12 out vec2 v_uv;
13 
14 uniform mat4 u_matrix;
15 uniform float u_overlay_scale;
16 
17 void main() {
18  // This vertex shader expects a EXTENT x EXTENT quad,
19  // The UV co-ordinates for the overlay texture can be calculated using that knowledge
20  v_uv = a_pos / 8192.0;
21  gl_Position = u_matrix * vec4(a_pos * u_overlay_scale, 0, 1);
22 }
23 )";
24  static constexpr const char* fragment = R"(uniform highp vec4 u_color;
25 uniform sampler2D u_overlay;
26 
27 in vec2 v_uv;
28 
29 void main() {
30  vec4 overlay_color = texture(u_overlay, v_uv);
31  fragColor = mix(u_color, overlay_color, overlay_color.a);
32 }
33 )";
34 };
35 
36 } // namespace shaders
37 } // namespace mbgl
@ OpenGL
The OpenGL API backend.
BuiltIn
This enum is used with the ShaderSource template to select source code for the desired program and gr...
Definition: actor.hpp:15
Select shader source based on a program type and a desired graphics API.