Fix uniformity bug in ui shader

This commit is contained in:
João Capucho 2021-07-31 21:34:29 +01:00
parent 7acca36629
commit 82489782b4
No known key found for this signature in database
GPG Key ID: 1AD5CE7CCAEBDA21

View File

@ -21,11 +21,11 @@ layout(location = 0) out vec4 tgt_color;
void main() {
// Text
if (f_mode == uint(0)) {
tgt_color = f_color * vec4(1.0, 1.0, 1.0, texture(sampler2D(t_tex, s_tex), f_uv).a);
tgt_color = f_color * vec4(1.0, 1.0, 1.0, textureLod(sampler2D(t_tex, s_tex), f_uv, 0).a);
// Image
// HACK: bit 0 is set for both ordinary and north-facing images.
} else if ((f_mode & uint(1)) == uint(1)) {
tgt_color = f_color * texture(sampler2D(t_tex, s_tex), f_uv);
tgt_color = f_color * textureLod(sampler2D(t_tex, s_tex), f_uv, 0);
// 2D Geometry
} else if (f_mode == uint(2)) {
tgt_color = f_color;