mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-16 04:18:11 +00:00
[client] renderer/egl: implement support for rendering help text
The help text is rendered in the bottom left corner on a semi-transparent background, very similar to how the FPS text is rendered.
This commit is contained in:
11
client/renderers/EGL/shader/help.frag
Normal file
11
client/renderers/EGL/shader/help.frag
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 300 es
|
||||
|
||||
in highp vec2 uv;
|
||||
out highp vec4 color;
|
||||
|
||||
uniform sampler2D sampler1;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = texture(sampler1, uv);
|
||||
}
|
22
client/renderers/EGL/shader/help.vert
Normal file
22
client/renderers/EGL/shader/help.vert
Normal file
@@ -0,0 +1,22 @@
|
||||
#version 300 es
|
||||
|
||||
layout(location = 0) in vec3 vertexPosition_modelspace;
|
||||
layout(location = 1) in vec2 vertexUV;
|
||||
|
||||
uniform vec2 screen;
|
||||
uniform vec2 size;
|
||||
|
||||
out highp vec2 uv;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position.xyz = vertexPosition_modelspace;
|
||||
gl_Position.w = 1.0;
|
||||
gl_Position.xy *= screen.xy * size.xy;
|
||||
gl_Position.x -= 1.0 - (screen.x * size.x);
|
||||
gl_Position.y -= 1.0 - (screen.y * size.y);
|
||||
gl_Position.x += screen.x * 10.0;
|
||||
gl_Position.y += screen.y * 10.0;
|
||||
|
||||
uv = vertexUV;
|
||||
}
|
8
client/renderers/EGL/shader/help_bg.frag
Normal file
8
client/renderers/EGL/shader/help_bg.frag
Normal file
@@ -0,0 +1,8 @@
|
||||
#version 300 es
|
||||
|
||||
out highp vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = vec4(0.0, 0.0, 1.0, 1.0);
|
||||
}
|
Reference in New Issue
Block a user