demo/snake/shader/player.glsl

Thu, 09 Oct 2025 19:22:21 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 09 Oct 2025 19:22:21 +0200
changeset 279
97a1a7fb4f1a
parent 267
92fdd53de74f
permissions
-rw-r--r--

do not use different vocabulary (enable/disable vs. pause/unpause) for the behavior's enabled-state

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