MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fill.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 
13 uniform mat4 u_matrix;
14 
15 #ifndef HAS_UNIFORM_u_color
16 uniform lowp float u_color_t;
17 layout (location = 1) in highp vec4 a_color;
18 out highp vec4 color;
19 #else
20 uniform highp vec4 u_color;
21 #endif
22 #ifndef HAS_UNIFORM_u_opacity
23 uniform lowp float u_opacity_t;
24 layout (location = 2) in lowp vec2 a_opacity;
25 out lowp float opacity;
26 #else
27 uniform lowp float u_opacity;
28 #endif
29 
30 void main() {
31  #ifndef HAS_UNIFORM_u_color
32 color = unpack_mix_color(a_color, u_color_t);
33 #else
34 highp vec4 color = u_color;
35 #endif
36  #ifndef HAS_UNIFORM_u_opacity
37 opacity = unpack_mix_vec2(a_opacity, u_opacity_t);
38 #else
39 lowp float opacity = u_opacity;
40 #endif
41 
42  gl_Position = u_matrix * vec4(a_pos, 0, 1);
43 }
44 )";
45  static constexpr const char* fragment = R"(#ifndef HAS_UNIFORM_u_color
46 in highp vec4 color;
47 #else
48 uniform highp vec4 u_color;
49 #endif
50 #ifndef HAS_UNIFORM_u_opacity
51 in lowp float opacity;
52 #else
53 uniform lowp float u_opacity;
54 #endif
55 
56 void main() {
57  #ifdef HAS_UNIFORM_u_color
58 highp vec4 color = u_color;
59 #endif
60  #ifdef HAS_UNIFORM_u_opacity
61 lowp float opacity = u_opacity;
62 #endif
63 
64  fragColor = color * opacity;
65 
66 #ifdef OVERDRAW_INSPECTOR
67  fragColor = vec4(1.0);
68 #endif
69 }
70 )";
71 };
72 
73 } // namespace shaders
74 } // 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.