share/hedgewars/Data/Shaders/default.fs
author Wuzzy <Wuzzy2@mail.ru>
Wed, 22 Aug 2018 00:40:11 +0200 (2018-08-21)
branch0.9.24
changeset 13693 076b7d23fab8
parent 12891 a089326f0e16
child 15298 042a5e8d9c59
permissions -rw-r--r--
Backed out changeset 6c0cf6b9eff8. Scripters should be prepared for nil and pretending the gear exists would cause more pain
#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;
    }
}