11 static constexpr
const char* vertex = R
"(layout (location = 0) in vec2 a_pos;
14 uniform mat4 u_matrix;
15 uniform float u_overlay_scale;
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);
24 static constexpr
const char* fragment = R
"(uniform highp vec4 u_color;
25 uniform sampler2D u_overlay;
30 vec4 overlay_color = texture(u_overlay, v_uv);
31 fragColor = mix(u_color, overlay_color, overlay_color.a);
@ OpenGL
The OpenGL API backend.
BuiltIn
This enum is used with the ShaderSource template to select source code for the desired program and gr...
Select shader source based on a program type and a desired graphics API.