mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-15 20:25:00 +01:00
16 lines
No EOL
389 B
GLSL
16 lines
No EOL
389 B
GLSL
uniform sampler2D texture;
|
|
uniform float ambient;
|
|
uniform bool has_texture;
|
|
|
|
void main()
|
|
{
|
|
// lookup the pixel in the texture
|
|
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
|
|
|
|
// multiply it by the color
|
|
vec4 col = gl_Color;
|
|
if (has_texture) {
|
|
col = gl_Color * pixel;
|
|
}
|
|
gl_FragColor = vec4(col.x * ambient, col.y * ambient, col.z * ambient, col.w);
|
|
} |