diff options
author | chai <chaifix@163.com> | 2021-11-02 19:44:01 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-02 19:44:01 +0800 |
commit | 72812a7b47f90f9460e54e8149ba9199a7841244 (patch) | |
tree | 9ebdb4b65d7cbbc0a3d7c436a9b45d4eff351b62 /Data/Resources/Shaders/Editor-Text.glsl | |
parent | b7511abf1a1f302b5c7ebf50faaf65b62d7bb6ed (diff) |
! Text mesh done
Diffstat (limited to 'Data/Resources/Shaders/Editor-Text.glsl')
-rw-r--r-- | Data/Resources/Shaders/Editor-Text.glsl | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Data/Resources/Shaders/Editor-Text.glsl b/Data/Resources/Shaders/Editor-Text.glsl index e2c2ae7..c58bd48 100644 --- a/Data/Resources/Shaders/Editor-Text.glsl +++ b/Data/Resources/Shaders/Editor-Text.glsl @@ -7,8 +7,7 @@ DepthTest Off CMD_END uniform mat4 gamelab_mat_mvp; -uniform sampler2D uiTex; -uniform vec2 uiText_ST; +uniform sampler2D gamelab_main_tex; VSH_BEGIN layout (location = 0) in vec2 vPos; @@ -16,24 +15,30 @@ layout (location = 1) in vec2 vUV; layout (location = 2) in vec4 vColor; out vec2 uv; +out vec4 color; void main() { - vec4 clip = gamelab_mat_mvp * vec4(vPos, -1, 1.0); + vec2 pos = vPos + vec2(10, 40); + vec4 clip = gamelab_mat_mvp * vec4(pos, -1, 1.0); gl_Position = clip; uv = vUV; + color = vColor; } VSH_END FSH_BEGIN in vec2 uv; +in vec4 color; 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; + //vec2 uv = vec2(uv.x, 1 - uv.y); + vec4 sampled = vec4(1,1,1,texture(gamelab_main_tex, uv).r); + sampled *= color; + // vec4 sampled = vec4(1,1,1,1); + FragColor = sampled; } FSH_END |