diff options
author | chai <chaifix@163.com> | 2021-10-31 14:27:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-31 14:27:26 +0800 |
commit | 601442f94fc0dcfdc5a117c5f87d90b156d53045 (patch) | |
tree | b006bcd6a28a965a900c64f4716007fcb45eee98 /Data/Resources/Shaders | |
parent | 26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 (diff) |
+static initiator
Diffstat (limited to 'Data/Resources/Shaders')
-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 |