MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
heatmap_texture.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"(uniform mat4 u_matrix;
12 uniform vec2 u_world;
13 layout (location = 0) in vec2 a_pos;
14 out vec2 v_pos;
15 
16 void main() {
17  gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);
18 
19  v_pos.x = a_pos.x;
20  v_pos.y = 1.0 - a_pos.y;
21 }
22 )";
23  static constexpr const char* fragment = R"(uniform sampler2D u_image;
24 uniform sampler2D u_color_ramp;
25 uniform float u_opacity;
26 in vec2 v_pos;
27 
28 void main() {
29  float t = texture(u_image, v_pos).r;
30  vec4 color = texture(u_color_ramp, vec2(t, 0.5));
31  fragColor = color * u_opacity;
32 
33 #ifdef OVERDRAW_INSPECTOR
34  fragColor = vec4(0.0);
35 #endif
36 }
37 )";
38 };
39 
40 } // namespace shaders
41 } // 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.