diff options
Diffstat (limited to 'Data/Resources/Shaders/Editor-Text.glsl')
-rw-r--r-- | Data/Resources/Shaders/Editor-Text.glsl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Data/Resources/Shaders/Editor-Text.glsl b/Data/Resources/Shaders/Editor-Text.glsl new file mode 100644 index 0000000..7a88fcf --- /dev/null +++ b/Data/Resources/Shaders/Editor-Text.glsl @@ -0,0 +1,34 @@ +#version 330 core + +uniform mat4 gamelab_mat_mvp; +uniform sampler2D uiTex; +uniform vec2 uiText_ST; + +VSH_BEGIN +layout (location = 0) in vec2 vPos; +layout (location = 1) in vec2 vUV; + +out vec2 uv; + +void main() +{ + vec4 clip = gamelab_mat_mvp * vec4(vPos, -1, 1.0); + gl_Position = clip; + uv = vUV; +} + +VSH_END + +FSH_BEGIN +in vec2 uv; + +out vec4 FragColor; + +void main() +{ + vec2 uv = vec2(uv.x, 1 - uv.y); + vec4 sampled = vec4(1,1,1,texture(uiTex, uv).r); + FragColor = sampled; +} + +FSH_END
\ No newline at end of file |