demo/snake/shader/player.glsl

Tue, 28 Oct 2025 22:03:06 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 28 Oct 2025 22:03:06 +0100
changeset 282
8c5540b31087
parent 267
92fdd53de74f
permissions
-rw-r--r--

fix that dependencies for tools are always checked

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