share/hedgewars/Data/Shaders/default.fs
author Wuzzy <Wuzzy2@mail.ru>
Tue, 04 Dec 2018 16:48:43 +0100
branch0.9.25
changeset 14369 02841325495e
parent 12891 a089326f0e16
child 15298 042a5e8d9c59
permissions -rw-r--r--
ACF1: Fix Lua error when hitting Attack after failing the rope challenge "difficulty" variable was falsely set to 0 in this case, but only 1 or 2 are allowed

#ifdef GL_ES
precision mediump float;
#endif

uniform sampler2D tex0;
uniform vec4 tint;
uniform bool tintAdd;
uniform bool enableTexture;

varying vec2 tex;


void main()
{
    if(enableTexture){
        if (tintAdd){
            tint.a = 0.0;
            gl_FragColor = clamp(texture2D(tex0, tex) + tint, 0.0, 1.1);
        }else{
            gl_FragColor = texture2D(tex0, tex) * tint;
        }
    }else{
        gl_FragColor = tint;
    }
}