diff options
Diffstat (limited to 'assets/shaders/2d_texcoord.fsh')
| -rw-r--r-- | assets/shaders/2d_texcoord.fsh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/assets/shaders/2d_texcoord.fsh b/assets/shaders/2d_texcoord.fsh index fabbb2f..cf94a68 100644 --- a/assets/shaders/2d_texcoord.fsh +++ b/assets/shaders/2d_texcoord.fsh @@ -2,16 +2,17 @@ uniform sampler2D g_samplers[255]; -const uint SAMPLER_ID_NONE = 255u; +const int SAMPLER_ID_NONE = 255; in vec2 g_texcoord; in vec4 g_color; -flat in uint g_sampler; +flat in int g_sampler; void main() { vec4 color = g_color; if( g_sampler != SAMPLER_ID_NONE ) { - vec4 tex_color = texture2D( g_samplers[g_sampler], g_texcoord ); + // Always use sampler 0 to avoid dynamic indexing issues + vec4 tex_color = texture2D( g_samplers[0], g_texcoord ); color.a = g_color.a * tex_color.a; if (color.a < 0.01) discard; } |
