test/snake/shader/player.glsl

Sat, 16 Aug 2025 22:59:49 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 16 Aug 2025 22:59:49 +0200
changeset 265
5c915d01bdc0
parent 242
6eeb987f1681
permissions
-rw-r--r--

add simple game over screen

layout(location = 0) out vec4 diffuse;
in vec2 uvcoord;

uniform sampler2D map_albedo;
uniform sampler2D map_color;
uniform vec4 color;

void main(void) {
    // TODO: use greyscale texture instead
    vec4 color_map_pixel = texture(map_color, uvcoord);
    if (color_map_pixel.a > 0) {
        diffuse = color * color_map_pixel * texture(map_albedo, uvcoord);
    } else {
        diffuse = texture(map_albedo, uvcoord);
    }
}

mercurial