From ec934bf2f0f3536c1b4d31b4ca002f6f38ada9fe Mon Sep 17 00:00:00 2001 From: rom Date: Sat, 24 Apr 2021 03:19:22 +0200 Subject: font rendering --- txtgameengine/builtin_res/shaders/font/fragment.glsl | 12 ++++++++++++ txtgameengine/builtin_res/shaders/font/vertex.glsl | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 txtgameengine/builtin_res/shaders/font/fragment.glsl create mode 100644 txtgameengine/builtin_res/shaders/font/vertex.glsl (limited to 'txtgameengine/builtin_res/shaders') diff --git a/txtgameengine/builtin_res/shaders/font/fragment.glsl b/txtgameengine/builtin_res/shaders/font/fragment.glsl new file mode 100644 index 0000000..d9d36fd --- /dev/null +++ b/txtgameengine/builtin_res/shaders/font/fragment.glsl @@ -0,0 +1,12 @@ +#version 330 core + +in vec2 UV; + +out vec3 color; + +uniform sampler2D textureSampler; + +void main() { + color = texture(textureSampler, UV).rgb; +} + diff --git a/txtgameengine/builtin_res/shaders/font/vertex.glsl b/txtgameengine/builtin_res/shaders/font/vertex.glsl new file mode 100644 index 0000000..dd93afb --- /dev/null +++ b/txtgameengine/builtin_res/shaders/font/vertex.glsl @@ -0,0 +1,12 @@ +#version 330 core + +layout(location=0) in vec3 vertexPosition_modelspace; +layout(location=1) in vec2 vertexUV; + +out vec2 UV; + +void main() { + gl_Position = vec4(vertexPosition_modelspace, 1); + UV = vertexUV; +} + -- cgit